<reponame>yellowjaguar5/lnldb
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-03-16 17:24
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('members', '0002_auto_20160107_0520'),
    ]

    operations = [
        migrations.CreateModel(
            name='Trainee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('revoked', models.BooleanField(default=False)),
                ('revoked_on', models.DateTimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True)),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='trainings', to=settings.AUTH_USER_MODEL)),
                ('revoked_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='trainings_revoked', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'permissions': (('revoke_training', "Revoke a member's training"), ('edit_trainee_notes', 'Edit training notes on a person')),
            },
        ),
        migrations.CreateModel(
            name='Training',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('recorded_on', models.DateTimeField(auto_now_add=True)),
                ('expiration_date', models.DateField(blank=True, null=True)),
                ('notes', models.TextField(blank=True)),
                ('recorded_by', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='trainings_entered', to=settings.AUTH_USER_MODEL)),
                ('trainer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='trainings_run', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-date', '-recorded_on'],
                'permissions': (('view_training', 'View a training'),),
            },
        ),
        migrations.CreateModel(
            name='TrainingType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
                ('external', models.BooleanField(default=False)),
                ('description', models.TextField()),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='training',
            name='training_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='trainings', to='members.TrainingType'),
        ),
        migrations.AddField(
            model_name='trainee',
            name='training',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trainees', to='members.Training'),
        ),
        migrations.AlterOrderWithRespectTo(
            name='trainee',
            order_with_respect_to='training',
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-03-16 17:24
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('members', '0002_auto_20160107_0520'),
    ]

    operations = [
        migrations.CreateModel(
            name='Trainee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('revoked', models.BooleanField(default=False)),
                ('revoked_on', models.DateTimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True)),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='trainings', to=settings.AUTH_USER_MODEL)),
                ('revoked_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='trainings_revoked', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'permissions': (('revoke_training', "Revoke a member's training"), ('edit_trainee_notes', 'Edit training notes on a person')),
            },
        ),
        migrations.CreateModel(
            name='Training',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('recorded_on', models.DateTimeField(auto_now_add=True)),
                ('expiration_date', models.DateField(blank=True, null=True)),
                ('notes', models.TextField(blank=True)),
                ('recorded_by', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='trainings_entered', to=settings.AUTH_USER_MODEL)),
                ('trainer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='trainings_run', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-date', '-recorded_on'],
                'permissions': (('view_training', 'View a training'),),
            },
        ),
        migrations.CreateModel(
            name='TrainingType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
                ('external', models.BooleanField(default=False)),
                ('description', models.TextField()),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='training',
            name='training_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='trainings', to='members.TrainingType'),
        ),
        migrations.AddField(
            model_name='trainee',
            name='training',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trainees', to='members.Training'),
        ),
        migrations.AlterOrderWithRespectTo(
            name='trainee',
            order_with_respect_to='training',
        ),
    ]
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-03-16 17:24