-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddData_v2.py
922 lines (891 loc) · 16.8 KB
/
addData_v2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
nameList = [
"Oliver",
"Jake",
"Noah",
"James",
"Jack",
"Connor",
"Liam",
"John",
"Harry",
"Callum",
"Mason",
"Robert",
"Jacob",
"Jacob",
"Jacob",
"Michael",
"Charlie",
"Kyle",
"William",
"William",
"Thomas",
"Joe",
"Ethan",
"David",
"George",
"Reece",
"Michael",
"Richard",
"Oscar",
"Rhys",
"Alexander",
"Joseph",
"James",
"Charlie",
"James",
"Charles",
"William",
"Damian",
"Daniel",
"Thomas",
"Jeffery",
"Billy",
"Franky",
"Joe",
"Wayne",
"Woody",
"Gregg",
"Monty",
"Brose",
"Tracy",
"Nell",
"Gilbert",
"Corey",
"Evan",
"Quincy",
"Victor",
"Gordy",
"Kester",
"Milo",
"Vinny",
"Nelson",
"Marc",
"Alvin",
"Lindsey",
"Casey",
"Nevile",
"Artie",
"Deane",
"Roland",
"Abram",
"etie",
"Donnie",
"Kurt",
"Norman",
"Son",
"Ossy",
"Horatio",
"Winny",
"Vance",
"Dwayne",
"Burt",
"Moss",
"Hubert",
"Lincoln",
"Eric",
"Barnie",
"Louis",
"Mal",
"Sam",
"Harvey",
"Oscar",
"Davie",
"Howard",
"Everard",
"Rodger",
"Cory",
"Elbert",
"Cassius",
"Quenton",
"Andrew",
"Everett",
"Bruce",
"Anselm",
"Van",
"Cy",
"Carry",
"Louie",
"Stef",
"Wesley",
"Anton",
"Rufus",
"Leigh",
"lme",
"Marcus",
"Newt",
"Ray",
"Lucian",
"Samson",
"Micky",
"Kenny",
"Brett",
"Jarvis",
"Xavier",
"Kyle",
"DDen",
"Osborn",
"Corney",
"Lindon",
"SSny",
"Lowell",
"Leonard",
"Joseph",
"Alonso",
"Alwyn",
"Osmond",
"Rod",
"Nate",
"Gustus",
"Chrr",
"Bob",
"Keith",
"Aaron",
"Norbert",
"Herman",
"Benny",
"Frankie",
"Russel",
"Cary",
"Cam",
"Randall",
"Maxwell",
"Hill",
"Mannie",
"Monroe",
"Dunny",
"Rupert",
"Bat",
"Winston",
"Lon",
"Dusty",
"Leon",
"Horace",
"Morris",
"Hilly",
"GriGrif",
"Tris",
"Gordon",
"Emmery",
"Mick",
"Sanford",
"Emmett",
"rd",
"Lance",
"Blake",
"Norris",
"Al",
"Tony",
"eric",
"RReggie",
"cy",
"Stephen",
"Norm",
"Ty",
"Seth",
"Roly",
"Ronnie",
"DDennis",
"Vaughn",
"Lew",
"Lex",
"Travis",
"Rudolf",
"Alonzo",
"Barry",
"Fred",
"Cass",
"Vincent",
"Freddy",
"Os",
"Brady",
"Cal",
"Antony",
"Jimmie",
"Urias",
"Harry",
"Noah",
"Ramond",
"Bertr",
"Emory",
"Brand",
"Lorence",
"Miles",
"Bennie",
"Billie",
"Raymund",
"Grant",
"Lauren",
"Phil",
"Alf",
"Eldred",
"Alva",
"Isadore",
"Brian",
"Ken",
"Tyron",
"Glen",
"Lennie",
"Basil",
"Clyde",
"Monte",
"Cameron",
"Ozzie",
"Doug",
"Natty",
"Duddy",
"Fredric",
"Philip",
"Joshua",
"CCCCCC",
"Morty",
"Val",
"Matthew",
"Nigel",
"Fergu",
"Hilary",
"Brandy",
"Sid",
"Erik",
"Ruby",
"Uriah",
"August",
"Vern",
"Bass",
"Jake",
"Kelvin",
"Noel",
"Willy",
"Duncan",
"ius",
"Raff",
"Jeffrey",
"Bradley",
"DavDavD",
"Garry",
"Lee",
"Manuel",
"Abraham",
"Orlando",
"Troy",
"Lars",
"Nick",
"er",
"Donald",
"Stacy",
"Floyd",
"Casper",
"Rodge",
"Chet",
"Wallie",
"Alaster",
"Robert",
"Oswold",
"Stan",
"Dave",
"Carrol",
"Bram",
"Alfred",
"Arnie",
"Art",
"Munroe",
"Bernard",
"Sydney",
"Rodney",
"Osborne",
"Andy",
"Lamont",
"ldred",
"Zachary",
"Donovan",
"Dud",
"Howie",
"Vernon",
"Rudy",
"Wendell",
"Petey",
"Christy",
"Chris",
"Ozzy",
"Bobbie",
"Kelley",
"oyde",
"Loren",
"Mort",
"Terreeo",
"Duane",
"Leo",
"Karl",
"Dennis",
"Alger",
"Shel",
"Eddie",
"Jim",
"Herbert",
"Carl",
"Gerry",
"Serge",
"Lyss",
"Augie",
"Alan",
"Addy",
"William",
"Warren",
"Ford",
"Alvah",
"Archie",
"Bart",
"Stuart",
"Zach",
"Elmer",
"Roge",
"George",
"Abel",
"Shelton",
"Ambrose",
"Clive",
"Dean",
"Berney",
"Bret",
"Brandon",
"Aleck",
"John",
"Stevie",
"Larry",
"Carroll",
"Caspar",
"ssius",
"Darrell",
"Verne",
"Batty",
"Nevill",
"Gregory",
"Rubin",
"Alfonso",
"Alfie",
"Sander",
"Cas",
"Miitch",
"Renny",
"Branden",
"Lovell",
"Gussy",
"Oz",
"Lin",
"Lionel",
"Vick",
"Gerald",
"Fergus",
"nny",
"Herb",
"Rolly",
"Ryan",
"Ulysses",
"Rolfe",
"Dell",
"JJohn",
"Jeremy",
"las",
"Greg",
"ester",
"Rowly",
"Jody",
"Griffin",
"Steff",
"Tobi",
"Graham",
"Freddie",
"Isidor",
"Les",
"Ronny",
"Emile",
"Geordie",
"Rudolph",
"Steph",
"Byron",
"Marion",
"Jeff",
"Russ",
"AaRoss",
"Rex",
"Neil",
"Wilfrid",
"Don",
"Em",
"Arthur",
"Barrie",
"Curt",
"Isador",
"Willard",
"Zave",
"Mark",
"Allen",
"Osmund",
"Barnard",
"Hillary",
"Trent",
"Jimmy",
"Phillip",
"Alec",
"Egbert",
"Roger",
"Rube",
"Stanley",
"VVVirge",
"Seymour",
"Emil",
"ram",
"Ade",
"Lonnie",
"Rene",
"Quentin",
"Hillie",
"Quinn",
"Angus",
"Floy",
"Kel",
"Bruno",
"Algie",
"Lynn",
"El",
"Algy",
"Gus",
"Donny",
"Jem",
"Jos",
"Rand",
"Gust",
"Anse",
"Dolph",
"Norrie",
"Stewart",
"ton",
"Todd",
"Seb",
"Alex",
"Doyle",
"Ralphy",
"Len",
"Lindsay",
"Win",
"Jessy",
"Pat",
"Stu",
"Newton",
"Emery",
"Avy",
"Glenn",
"Phn",
"Baldie",
"ard",
"Kris",
"Jamie",
"Logan",
"Frank",
"Dolf",
"Jervis",
"Nowell",
"Joey",
"Rolph",
"Lenny",
"Alwin",
"Roy",
"Jacky",
"Jerry",
"Lonny",
"Myles",
"Adam",
"Albert",
"Shane",
"Rowland",
"Steven",
"Ricky",
"Lawrie",
"ABert",
"Kit",
"Wilfred",
"Kirk",
"Spencer",
"Kendall",
"Addie",
"Brenton",
"Huge",
"Nor",
"Gil",
"Nel",
"Quinton",
"Nicolas",
"Shelly",
"Alister",
"Amos",
"Walt",
"Abe",
"Linus",
"Arnold",
"Roddy",
"Samuel",
"Willie",
"Homer",
"Jay",
"Rufe",
"Danny",
"an",
"Corny",
"Ned",
"Cris",
"Jack",
"Dick",
"Del",
"QQuincy",
"Arch",
"Cyril",
"Fran",
"Ab",
"Anthony",
"Abbie",
"Vin",
"James",
"Clint",
"Poldie",
"Bert",
"Kristof",
"Uria",
"Matt",
"Mickey",
"Steve",
"Tyler",
"Clinton",
"Lyndon",
"Bartley",
"Barrett",
"Blair",
"Jared",
"Adrian",
"Sampson",
"Oswald",
"Tyrone",
"Dale",
"Jason",
"Lou",
"Ruben",
"Jon",
"Wilbert",
"Kasey",
"Barty",
"Reuben",
"Sandy",
"Davy",
"Ralph",
"Will",
"Hube",
"Vince",
"Aron",
"Osbert",
"Reynold",
"Davey",
"Ev",
"Jacob",
"Nollie",
"Sidney",
"Toby",
"Neville",
"Dmenic",
"Georgie",
"Brad",
"Benjy",
"Lester",
"Wally",
"lly",
"Uri",
"Lu",
"Bertram",
"Dudley",
"Lorenzo",
"Leopold",
"Drew",
"Rafael",
"Gregor",
"Ad",
"Rolf",
"Eddy",
"Saul",
"Otis",
"Nat",
"Nevil",
"Manny",
"Dustin",
"Jackie",
"Baldwin",
"Nicky",
"Lewie",
"Connie",
"Stew",
"Stacey",
"Raphael",
"Jasper",
"Burton",
"Vic",
"WFred",
"Delbert",
"Neal",
"Rafe",
"Ambie",
"Boris",
"SSidney",
"Abner",
"Terence",
"Bryan",
"Randy",
"Allan",
"Dan",
"Dom",
"Ron",
"Kelly",
"Sammy",
"Barney",
"Dck",
"Avery",
"Ansel",
"Bertie",
"Bernie",
"Loy",
"Joel",
"Jo",
"Nels",
"Wilber",
"Hugh",
"Gerard",
"Con",
"Rick",
"Zacky",
"Linc",
"Nicol",
"Quintin",
"Richard",
"Dunk",
"Lucius",
"Wnnie",
"Wes",
"Jessie",
"Carol",
"Russell",
"Austin",
"Vaughan",
"Mo",
"Tobie",
"Nige",
"Wilbur",
"Ben",
"Laurie",
"Jonny",
"HHugh",
"Lambert",
"Zack",
"Abie",
"Colin",
"Brent",
"Conny",
"Duke",
"Cole",
"Randal",
"Normie",
"Alvan",
"Tracey",
]
nameList = list(set(nameList))
addressList = ["臺南市玉井區竹圍里大成路351號", "臺北市大安區愛國東路31號5樓 ", "臺北市忠孝東路一段112號12樓"]
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User, Group, Permission
from main.models import Student_content, Entrepreneur_content, Post, QA, LikeList
## generate group and permission
# create perission
ct = ContentType.objects.get_for_model(User)
per_stu = Permission.objects.create(
codename="can_apply", name="Can apply for job", content_type=ct
)
per_ent = Permission.objects.create(
codename="can_post", name="Can post job", content_type=ct
)
# create group and add permissions to groups
Group.objects.create(name="student")
Group.objects.create(name="entrepreneur")
stu_group = Group.objects.get(name="student")
ent_group = Group.objects.get(name="entrepreneur")
stu_group.permissions.add(per_stu)
ent_group.permissions.add(per_ent)
# stu_group.user_set.add()#add User object
# ent_group.user_set.add()#add User object
## generate user
pid = 1
for i, name in enumerate(nameList):
if i % 4 == 0:
ln = "Lin"
year = "1992"
elif i % 4 == 1:
ln = "Won"
year = "1980"
elif i % 4 == 2:
ln = "Lee"
year = "1991"
else:
ln = "Chen"
year = "1997"
User.objects.create(
username=name + year + str(i * 31),
first_name=name,
last_name=ln,
email=name + "@mail.com",
# phone='09'+str((11111111*i)%10000000000),
is_staff=False,
is_active=True,
)
user = User.objects.get(username=name + year + str(i * 31))
user.set_password(name)
user.save()
if i % 5 == 0:
ad = addressList[(i % 3)]
if i % 4 == 0:
ti = "品管工程師"
elif i % 4 == 1:
ti = "資安工程師"
elif i % 4 == 2:
ti = "數據分析師"
else:
ti = "軟體測試工程師"
ent_group.user_set.add(user)
Entrepreneur_content.objects.create(
entrepreneur=user,
companytitle=nameList[i%200]+"有限公司",
introduction="""
創見資訊成立於1988年,總部設於台灣,由董事長束崇萬先生一手創立,\n
如今已成為為全球消費性電子與工業用產品領導廠商,擁有專業的研發、\n
生產、業務與行銷團隊,在全球共擁有13個據點。在創見,我們秉持高\n
品質的產品理念,並以客戶為中心,提供最專業的客戶服務,面對日益\n
變化的市場需求,創見有能力迅速做出反應,滿足各式各樣的消費需求。""",
address=addressList[(i % 3)],
phone="09" + str((11111111 * i) % 10000000000),
)
Post.objects.create(
postid=pid,
entrepreneur=user,
jobtype="internship",
title=ti,
detail="""1.公司商品推廣 \n
2.PG人員管理教育訓練 \n
管理人數:%d人以內\n
職務類別:\n
行銷企劃人員、產品企劃開發人員 工作待遇:\n
待遇面議 (經常性薪資達%d萬元或以上\n
工作性質:\n
全職\n
上班地點:\n
新北市五股區五權路57號(五股工業區) 管理責任:\n
管理人數未定\n
出差外派:\n
需出差,一年累積時間未定\n
上班時段:\n
晚班,中班\n
休假制度:\n
依公司規定\n
可上班日:\n
不限\n
需求人數:\n
%d 人\n"""
% (i + 1, i + 1, i + 1),
condition="""接受身份:\n
上班族\n
工作經歷:\n
不拘\n
學歷要求:\n
大學以上\n
科系要求:\n
企業管理相關、市場行銷相關\n
語文條件:\n
不拘\n
擅長工具:\n
不拘\n
工作技能:\n
不拘\n
具備駕照:\n
輕型機車、普通重型機車\n
其他條件:\n
未填寫\n
""",
benefit="""公司制度:員工在職教育訓練 \n
獎金福利:年節獎金、年終獎金 \n
保險福利:員工團保 \n
居住福利:員工宿舍 \n
娛樂福利:國內旅遊、國外旅遊、員工定期聚餐、員購優惠 \n
補助福利:員工結婚補助、生育補助、員工手機費補助、員工及眷屬喪葬補助 \n
其他福利:業績獎金、順暢的升遷管道\n
""",
contact="聯絡人:人力資源處 黃小姐",
min_salary=(30000 + i * 40 + i * i),
viewed=0,
like=0,
)
pid += 1
else:
stu_group.user_set.add(user)
Student_content.objects.create(
student=user,
mis_id=(
"B10"
+ str(i % 10)
+ str((i * 92) % 10)
+ "90"
+ str(i % 10)
+ str((i * 92) % 10)
),
resume="""
主管您好:\n
我是XXX,自小在新北三重成長,家中共有四位成員,上有一個哥哥,從小生長在嚴謹的環 \n
境中,父母對做事的態度很要求,因而培養我細心負責的人格特質,2014年6月畢業於雲林\n
科技大學企管研究所國企組,研究所專題為人才招募任用在企業倫理方面的研究。\n
●人力資源職涯的選擇\n
畢業前參加XX會的浙江暑期實習活動以及雲林科技大學的越南移地教學活動,藉以學習國際\n
企業在海外如何成功與運行,在中國XXXX國際大酒店中餐廳一個月的實習期間,我學習到了\n
人力資源的調度,因為服務員人數有限,服務區域廣泛,每日來客數變化大,瞭解到如何妥\n
善安排每一位服務員的工作職責,適度的每日或是每周輪替工作項目,以藉此降低員工的倦\n
怠程度,達到了全方位學習目的,提升全體人員的素質,是相當重要的人力資源管理政策。\n
因此在未來投入企業當中,我期盼能夠透過基層人資人員的角度從頭學起,實際站在企業\n
的永續經營角度思考員工招募任用管理以及後續人才發展政策的相關制定,期盼有機會進\n
入貴公司實務上接觸人力資源的範疇,為企業解決問題並創造員工工作熱忱永續帶來效益。\n
●多元能力的培養\n
●語言能力:\n
在求學期間考取多益700分,使我能應付日常社交需要和工作上有限的要求,可以用英語\n
進行一般社交場合的談話,能夠應付例行性的業務需求,參加英文會議,聽取大部分要點。\n
●活動經歷:\n
我的個性細心、積極且樂觀,做事負責,喜歡與人交流,在碩一系上舉辦的【第X屆國企\n
所暨二企三聯合成果展-XX】活動中,負責開場與解說第一張和第二張展板;我積極參\n
與,在講解展板時增進了臨機應變與溝通技巧,詳盡回答嘉賓的任何疑問,不懂之處也請\n
嘉賓給予指教,以敬業的態度全程參與,在活動結束後,成功地被評審選為佳作解說員,\n
給予了我很大的鼓勵。\n
●在碩二的【第XX屆中小企業產學合作研討會「XXXX,XXXX」】活動中,我也推薦自己\n
加入活動組的組員,藉以學習更多會場接待的機會與經驗,提升自己的膽量,也學習服務\n
的禮儀。\n
""",
)
#
#### QA 自己加入
## LikeList
from main.models import LikeList
s = User.objects.filter(
username__contains="c", groups=Group.objects.get(name="student")
)
p_all = Post.objects.all()
for i, stu in enumerate(s):
p = p_all[i % 31]
LikeList.objects.create(student=stu, post=p)
## add the number of like to post
from main.models import LikeList, Post
like = LikeList.objects.all()
postInLike = set()
for l in like:
postInLike.add(l.post)
for postL in postInLike:
numOfLike = len(LikeList.objects.filter(post=postL))
# print(postL.entrepreneur,numOfLike)
postL.like = numOfLike
postL.save()
print("done")