Skip to content

Commit

Permalink
Created TrainingEvent model in models.py. Binds TrainingEventMetrics …
Browse files Browse the repository at this point in the history
…to TrainingEvent correctly. Addresses #45.  Fixes #66.
  • Loading branch information
joncison committed Aug 13, 2020
1 parent 6e21ce5 commit ddd30b9
Show file tree
Hide file tree
Showing 2 changed files with 245 additions and 130 deletions.
38 changes: 38 additions & 0 deletions ifbcatsandbox_api/migrations/0069_auto_20200813_1204.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 3.0 on 2020-08-13 12:04

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('ifbcatsandbox_api', '0068_auto_20200813_1023'),
]

operations = [
migrations.CreateModel(
name='TrainingEvent',
fields=[
('event_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ifbcatsandbox_api.Event')),
('difficultyLevel', models.CharField(blank=True, choices=[('Novice', 'Novice'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')], help_text='The required experience and skills of the expected audience of the training event.', max_length=255)),
('learningOutcomes', models.TextField(blank=True, help_text='Expected learning outcomes from the training event.')),
('hoursPresentations', models.PositiveSmallIntegerField(blank=True, help_text='Total time (hours) of presented training material.', null=True, validators=[django.core.validators.MinValueValidator(1)])),
('hoursHandsOn', models.PositiveSmallIntegerField(blank=True, help_text='Total time (hours) of hands-on / practical work.', null=True, validators=[django.core.validators.MinValueValidator(1)])),
('hoursTotal', models.PositiveSmallIntegerField(blank=True, help_text='Total time investment (hours) of the training event, including recommended prework.', null=True, validators=[django.core.validators.MinValueValidator(1)])),
('personalised', models.BooleanField(blank=True, help_text='Whether the training is tailored to the individual in some way (BYOD, personal tutoring etc.)', null=True)),
('audienceRoles', models.ManyToManyField(blank=True, help_text='The professional roles of the expected audience of the training event.', related_name='trainingEvents', to='ifbcatsandbox_api.AudienceRole')),
('audienceTypes', models.ManyToManyField(blank=True, help_text='The education or professional level of the expected audience of the training event.', related_name='trainingEvents', to='ifbcatsandbox_api.AudienceType')),
('computingFacilities', models.ManyToManyField(blank=True, help_text='Computing facilities that the training event uses.', related_name='trainingEvents', to='ifbcatsandbox_api.ComputingFacility')),
('trainers', models.ManyToManyField(blank=True, help_text='Details of people who are providing training at the training event.', related_name='trainingEvents', to='ifbcatsandbox_api.Trainer')),
('trainingMaterials', models.ManyToManyField(blank=True, help_text='Training material that the training event uses.', related_name='trainingEvents', to='ifbcatsandbox_api.TrainingMaterial')),
],
bases=('ifbcatsandbox_api.event',),
),
migrations.AddField(
model_name='trainingeventmetrics',
name='trainingEvent',
field=models.ForeignKey(help_text='Training event to which the metrics are associated.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='metrics', to='ifbcatsandbox_api.TrainingEvent'),
),
]
Loading

0 comments on commit ddd30b9

Please sign in to comment.