-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathseed.py
47 lines (40 loc) · 1.29 KB
/
seed.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
from django.conf import settings
from django.contrib.auth import get_user_model
from caim_base.models.animals import Animal, Breed
from caim_base.models.awg import Awg
from caim_base.models.fosterer import FosterApplication, FostererProfile
from fake_data import (
load_zips,
load_breeds,
load_animals,
fake_fosterers,
fake_foster_applications,
fake_foster_application_suggestion,
fake_user_didnothing,
fake_staff_user,
fake_user_in_awg,
fake_user_in_awg_appviewonly,
fake_user_with_foster_profile_and_applications,
)
User = get_user_model()
assert not settings.PRODUCTION, "CANNOT RUN SEED.PY IN PRODUCTION"
Animal.objects.all().delete()
Awg.objects.all().delete()
Breed.objects.all().delete()
User.objects.all().delete()
FostererProfile.objects.all().delete()
FosterApplication.objects.all().delete()
load_zips()
load_breeds("dog", "seed_data/dog-breeds.json")
load_breeds("cat", "seed_data/cat-breeds.json")
load_animals("dog", "seed_data/dogs.json")
load_animals("dog", "seed_data/dogs2.json")
load_animals("dog", "seed_data/dogs3.json")
fake_fosterers(100)
fake_foster_applications()
fake_foster_application_suggestion()
fake_user_didnothing()
fake_staff_user()
fake_user_in_awg()
fake_user_in_awg_appviewonly()
fake_user_with_foster_profile_and_applications()