diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-02-29 08:06:34 +0000 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-02-29 08:06:34 +0000 |
commit | d74339006cb6a1e42aef6622fa9b7e5eca861ca2 (patch) | |
tree | 3e29572b7dd1fe7980203f13476964f9dcf93a23 /ctrack/organisations/management/commands/populate_db.py | |
parent | 41a67d4231c47bb5dc44b541b7d360ac79d21194 (diff) |
populates with essential services
Diffstat (limited to '')
-rw-r--r-- | ctrack/organisations/management/commands/populate_db.py | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py index 32e6ce4..e2bb23b 100644 --- a/ctrack/organisations/management/commands/populate_db.py +++ b/ctrack/organisations/management/commands/populate_db.py @@ -4,7 +4,7 @@ from random import randint, choice from django.core.management import BaseCommand from django.core.management import CommandParser -from ctrack.caf.tests.factories import GradingFactory, FileStoreFactory, CAFFactory +from ctrack.caf.tests.factories import GradingFactory, FileStoreFactory, CAFFactory, EssentialServiceFactory from ctrack.organisations.models import AddressType from ctrack.organisations.models import Mode from ctrack.organisations.models import Submode @@ -16,6 +16,21 @@ from ctrack.organisations.tests.factories import UserFactory from ctrack.register.tests.factories import EngagementEventFactory from ctrack.register.tests.factories import EngagementTypeFactory +fnames = [ + "Clock Pylon Systems", + "Ultramarine Hanglider Navigator", + "Membranous Floor Heaters", + "Alan's Wardrobe Hinge Circuits", + "Marine Sluicegate Extension Pulleys", + "Ironway Prob Modelling Area", + "Bufferage Clippers", + "Slow Gauze Thread Manipulator", + "Terratoast Piling", + "Accounting and Warehouse Conducer", + "Able Hopscotch Mirrors", + "Jolly Main Legacy Circuitry", +] + class Command(BaseCommand): help = """ @@ -120,9 +135,19 @@ class Command(BaseCommand): fs = FileStoreFactory.create(physical_location_organisation=orgs[1]) # Some CAF objects - for c in range(35): + cafs = [ CAFFactory.create( owner=random.choice(orgs), quality_grading__descriptor=random.choice(q_descriptors), confidence_grading__descriptor=random.choice(c_descriptors), - ) + ) for _ in range(35) + ] + + # TODO: Need to create a bunch of Essential Services to associate with these CAFs + es = [ + EssentialServiceFactory.create( + name=random.choice(fnames), + organisation=random.choice(orgs), + caf=random.choice(cafs) + ) for _ in range(35) + ] |