# Generated by Django 3.0.4 on 2020-03-19 06:25

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('email', models.CharField(max_length=50, unique=True)),
                ('username', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('password', models.CharField(max_length=20)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['first_name'],
            },
        ),
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('status', models.BooleanField()),
            ],
            options={
                'ordering': ['date'],
            },
        ),
        migrations.CreateModel(
            name='Batch',
            fields=[
                ('semester_id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('semester', models.CharField(max_length=20)),
                ('department', models.CharField(max_length=20)),
            ],
            options={
                'ordering': ['semester_id'],
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('code', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=50)),
                ('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teacher.Batch')),
                ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['code'],
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('registration_no', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('roll_no', models.CharField(max_length=10)),
                ('session', models.CharField(max_length=10)),
                ('attendances', models.ManyToManyField(through='teacher.Attendance', to='teacher.Course')),
                ('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teacher.Batch')),
            ],
            options={
                'ordering': ['first_name'],
            },
        ),
        migrations.AddField(
            model_name='attendance',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teacher.Course'),
        ),
        migrations.AddField(
            model_name='attendance',
            name='student',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teacher.Student'),
        ),
    ]
