This commit is contained in:
2021-12-28 21:58:56 +00:00
parent 14b73f6f50
commit 5554edf977
8 changed files with 177 additions and 55 deletions

View File

@@ -43,28 +43,131 @@ class Command(BaseCommand):
self.categories.append(category)
def setup_items(self):
names = ["Motorised Power Towers", "Catering", "Forgetting Cables", "Gazebo Construction", "Balanced Audio", "Unbalanced Audio", "BBQ/Bin Interactions", "Pushing Boxes", "How Not To Die", "Setting up projectors", "Basketing truss", "First Aid", "Digging Trenches", "Avoiding Bin Lorries", "Getting cherry pickers stuck in mud", "Crashing the Van", "Getting pigs to fly", "Basketing picnics", "Python programming", "Building Cables", "Unbuilding Cables", "Cat Herding", "Pancake making", "Tidying up", "Reading Manuals", "Bikeshedding", "DJing", "Partying", "Teccie Gym", "Putting dust covers on", "Cleaning Lights", "Water Skiing", "Drinking", "Fundamentals of Audio", "Fundamentals of Photons", "Social Interaction", "Discourse Searching", "Discord Searching", "Coiling Cables", "Kit Amnesties", "Van Insurance", "Subhire Insurance", "Paperwork", "More Paperwork", "Second Aid", "Being Old", "Maxihoists", "Sleazyhoists", "Telehoists", "Prolyte", "Prolights", "Making Phonecalls", "Quoting For A Rig", "Basic MIC", "Advanced MIC", "Avoiding MIC", "Washing Cables", "Cable Ramp", "Van Loading", "Trailer Loading", "Storeroom Loading", "Welding", "Fire Extinguishers", "Boring Conference AV", "Flyaway", "Short Leads", "RF Systems", "QLab", "Use of Ladders", "Working at Height", "Organising Training", "Organising Organising Training Training", "Mental Health First Aid", "Writing RAMS", "Makros Runs", "PAT", "Kit Fixing", "Kit Breaking", "Replacing Lamps", "Flying Pig Systems", "Procrastination", "Drinking Beer", "Sending Emails", "Email Signatures", "Digital Sound Desks", "Digital Lighting Desks", "Painting PS10s", "Chain Lubrication", "Big Power", "BIGGER POWER", "Pixel Mapping", "RDM", "Ladder Inspections", "Losing Crimpaz", "Scrapping Trilite", "Bin Diving", "Wiki Editing"]
names = [
"Motorised Power Towers",
"Catering",
"Forgetting Cables",
"Gazebo Construction",
"Balanced Audio",
"Unbalanced Audio",
"BBQ/Bin Interactions",
"Pushing Boxes",
"How Not To Die",
"Setting up projectors",
"Basketing truss",
"First Aid",
"Digging Trenches",
"Avoiding Bin Lorries",
"Getting cherry pickers stuck in mud",
"Crashing the Van",
"Getting pigs to fly",
"Basketing picnics",
"Python programming",
"Building Cables",
"Unbuilding Cables",
"Cat Herding",
"Pancake making",
"Tidying up",
"Reading Manuals",
"Bikeshedding",
"DJing",
"Partying",
"Teccie Gym",
"Putting dust covers on",
"Cleaning Lights",
"Water Skiing",
"Drinking",
"Fundamentals of Audio",
"Fundamentals of Photons",
"Social Interaction",
"Discourse Searching",
"Discord Searching",
"Coiling Cables",
"Kit Amnesties",
"Van Insurance",
"Subhire Insurance",
"Paperwork",
"More Paperwork",
"Second Aid",
"Being Old",
"Maxihoists",
"Sleazyhoists",
"Telehoists",
"Prolyte",
"Prolights",
"Making Phonecalls",
"Quoting For A Rig",
"Basic MIC",
"Advanced MIC",
"Avoiding MIC",
"Washing Cables",
"Cable Ramp",
"Van Loading",
"Trailer Loading",
"Storeroom Loading",
"Welding",
"Fire Extinguishers",
"Boring Conference AV",
"Flyaway",
"Short Leads",
"RF Systems",
"QLab",
"Use of Ladders",
"Working at Height",
"Organising Training",
"Organising Organising Training Training",
"Mental Health First Aid",
"Writing RAMS",
"Makros Runs",
"PAT",
"Kit Fixing",
"Kit Breaking",
"Replacing Lamps",
"Flying Pig Systems",
"Procrastination",
"Drinking Beer",
"Sending Emails",
"Email Signatures",
"Digital Sound Desks",
"Digital Lighting Desks",
"Painting PS10s",
"Chain Lubrication",
"Big Power",
"BIGGER POWER",
"Pixel Mapping",
"RDM",
"Ladder Inspections",
"Losing Crimpaz",
"Scrapping Trilite",
"Bin Diving",
"Wiki Editing"]
for i,name in enumerate(names):
for i, name in enumerate(names):
item = models.TrainingItem.objects.create(category=random.choice(self.categories), reference_number=random.randint(0, 100), name=name)
self.items.append(item)
def setup_levels(self):
items = self.items.copy()
ta = models.TrainingLevel.objects.create(level=models.TrainingLevel.TA, description="Passion will hatred faithful evil suicide noble battle. Truth aversion gains grandeur noble. Dead play gains prejudice god ascetic grandeur zarathustra dead good. Faithful ultimate justice overcome love will mountains inexpedient.", icon="address-card")
ta = models.TrainingLevel.objects.create(
level=models.TrainingLevel.TA,
description="Passion will hatred faithful evil suicide noble battle. Truth aversion gains grandeur noble. Dead play gains prejudice god ascetic grandeur zarathustra dead good. Faithful ultimate justice overcome love will mountains inexpedient.",
icon="address-card")
self.levels.append(ta)
tech_ccs = models.TrainingLevel.objects.create(level=models.TrainingLevel.TECHNICIAN, description="Technician Common Competencies. Spirit abstract endless insofar horror sexuality depths war decrepit against strong aversion revaluation free. Christianity reason joy sea law mountains transvaluation. Sea battle aversion dead ultimate morality self. Faithful morality.", icon="book-reader")
tech_ccs = models.TrainingLevel.objects.create(
level=models.TrainingLevel.TECHNICIAN,
description="Technician Common Competencies. Spirit abstract endless insofar horror sexuality depths war decrepit against strong aversion revaluation free. Christianity reason joy sea law mountains transvaluation. Sea battle aversion dead ultimate morality self. Faithful morality.",
icon="book-reader")
tech_ccs.prerequisite_levels.add(ta)
super_ccs = models.TrainingLevel.objects.create(level=models.TrainingLevel.SUPERVISOR, description="Depths disgust hope faith of against hatred will victorious. Law...", icon="user-graduate")
for i in range(0, 5):
if len(items) == 0:
break
item = random.choice(items)
items.remove(item)
if i % 3 == 0:
models.TrainingLevelRequirement.objects.create(level=tech_ccs, item=item, depth=random.choice(models.TrainingItemQualification.CHOICES)[0])
else:
models.TrainingLevelRequirement.objects.create(level=super_ccs, item=item, depth=random.choice(models.TrainingItemQualification.CHOICES)[0])
if len(items) == 0:
break
item = random.choice(items)
items.remove(item)
if i % 3 == 0:
models.TrainingLevelRequirement.objects.create(level=tech_ccs, item=item, depth=random.choice(models.TrainingItemQualification.CHOICES)[0])
else:
models.TrainingLevelRequirement.objects.create(level=super_ccs, item=item, depth=random.choice(models.TrainingItemQualification.CHOICES)[0])
icons = {
models.TrainingLevel.SOUND: ('microphone', 'microphone-alt'),
models.TrainingLevel.LIGHTING: ('lightbulb', 'traffic-light'),
@@ -72,7 +175,7 @@ class Command(BaseCommand):
models.TrainingLevel.RIGGING: ('link', 'pallet'),
models.TrainingLevel.HAULAGE: ('truck', 'route'),
}
for i,name in models.TrainingLevel.DEPARTMENTS:
for i, name in models.TrainingLevel.DEPARTMENTS:
technician = models.TrainingLevel.objects.create(level=models.TrainingLevel.TECHNICIAN, department=i, description="Moral pinnacle derive ultimate war dead. Strong fearful joy contradict battle christian faithful enlightenment prejudice zarathustra moral.", icon=icons[i][0])
technician.prerequisite_levels.add(tech_ccs)
supervisor = models.TrainingLevel.objects.create(level=models.TrainingLevel.SUPERVISOR, department=i, description="Spirit holiest merciful mountains inexpedient reason value. Suicide ultimate hope.", icon=icons[i][1])
@@ -98,4 +201,11 @@ class Command(BaseCommand):
supervisor.set_password('supervisor')
supervisor.groups.add(Group.objects.get(name="Keyholders"))
supervisor.save()
models.TrainingLevelQualification.objects.create(trainee=supervisor, level=models.TrainingLevel.objects.filter(level__gte=models.TrainingLevel.SUPERVISOR).exclude(department=models.TrainingLevel.HAULAGE).exclude(department__isnull=True).first(), confirmed_on=timezone.now(), confirmed_by=models.Trainee.objects.first())
models.TrainingLevelQualification.objects.create(
trainee=supervisor,
level=models.TrainingLevel.objects.filter(
level__gte=models.TrainingLevel.SUPERVISOR).exclude(
department=models.TrainingLevel.HAULAGE).exclude(
department__isnull=True).first(),
confirmed_on=timezone.now(),
confirmed_by=models.Trainee.objects.first())