File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 10
10
Organization .objects .all ().delete ()
11
11
12
12
fake = Seed .seeder ()
13
-
14
- fake .add_entity (Organization , 80 , {
13
+ args = {
14
+ 'country' : lambda x : fake .faker .random_element (elements = ('CA' , 'US' )),
15
+ 'region' : lambda x :fake .faker .state (),
16
+ 'address' : lambda x :fake .faker .address ().replace ("\n " ," " ),
17
+ 'postal_code' : lambda x :fake .faker .postalcode (),
18
+ }
19
+ org_args = args .copy ()
20
+ org_args .update ({
15
21
'name' : lambda x : fake .faker .company (),
16
- 'country' : lambda x : fake .faker .random_element (elements = ('CA' , 'MX' , 'US' ))
17
- })
18
- fake .add_entity (Contact , 80 , {
19
- 'country' : lambda x : fake .faker .random_element (elements = ('CA' , 'MX' , 'US' ))
20
22
})
23
+ fake .add_entity (Organization , 80 ,org_args )
24
+ fake .add_entity (Contact , 80 , args )
21
25
22
26
print ("execute" )
23
- fake .execute ()
27
+ fake .execute ()
You can’t perform that action at this time.
0 commit comments