コード例 #1
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('classroom', '0002_auto_20200509_1817'),
    ]

    operations = [
        migrations.CreateModel(
            name='ReferenceMaterial',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=100)),
                ('file',
                 models.FileField(
                     upload_to=classroom.models.upload_notes_file)),
                ('classroom_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='reference_materials',
                                   to='classroom.Classroom')),
                ('teacher_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='owns_reference_material',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.DeleteModel(name='Note', ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='TeachingMaterials',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('school',
                 models.CharField(max_length=50, verbose_name='Sekolah')),
                ('grade',
                 models.CharField(max_length=50,
                                  verbose_name='Tingkat kelas')),
                ('subject',
                 models.CharField(max_length=50,
                                  verbose_name='Mata Pelajaran')),
                ('topic', models.CharField(max_length=50,
                                           verbose_name='Topik')),
            ],
        ),
        migrations.CreateModel(
            name='Attachments',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('docs',
                 models.FileField(
                     upload_to=classroom.models.group_based_upload_to)),
                ('teaching_materials',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attachments',
                                   to='classroom.TeachingMaterials')),
            ],
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('classroom', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='classroom',
            name='name',
            field=models.CharField(default='class', max_length=50),
        ),
        migrations.AddField(
            model_name='classroom',
            name='uniqueCode',
            field=models.CharField(
                default=classroom.models.Classroom.generateUniqueCode,
                max_length=50),
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('grade', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Classroom',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('identifier', models.CharField(max_length=50, unique=True)),
                ('room', models.CharField(max_length=50)),
                ('days_of_week', models.CharField(max_length=30, validators=[django.core.validators.RegexValidator(re.compile('^\\d+(?:,\\d+)*\\Z'), code='invalid', message='Enter only digits separated by commas.'), classroom.models.Classroom.validate_comma_separated_weekday_list])),
                ('time', models.TimeField()),
                ('grade', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='classes', to='grade.grade')),
            ],
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PostFileContent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 models.FileField(
                     upload_to=classroom.models.user_directory_path)),
                ('posted', models.DateTimeField(auto_now_add=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('content', ckeditor.fields.RichTextField()),
                ('files', models.ManyToManyField(to='page.PostFileContent')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='Page_Owner',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #6
0
class Migration(migrations.Migration):

    dependencies = [
        ('classroom', '0003_auto_20171229_0510'),
    ]

    operations = [
        migrations.AlterField(
            model_name='class',
            name='students',
            field=models.ManyToManyField(blank=True, to='classroom.Student'),
        ),
        migrations.AlterField(
            model_name='classroompasscode',
            name='passcode',
            field=models.CharField(default=classroom.models.generate_passcode,
                                   max_length=10,
                                   unique=True),
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=75, verbose_name='description')),
                ('file', models.FileField(upload_to=classroom.models.upload_assignment_file)),
                ('max_marks', models.IntegerField(default=100)),
            ],
        ),
        migrations.CreateModel(
            name='Classroom',
            fields=[
                ('id', models.UUIDField(editable=False, primary_key=True, serialize=False, verbose_name='classroom id')),
                ('room_number', models.IntegerField(blank=True, verbose_name='room number')),
                ('course_name', models.CharField(max_length=60, verbose_name='course name')),
                ('joining_permission', models.BooleanField(default=True, verbose_name='joining permission')),
                ('teacher_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teaching_classrooms', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Classroom',
                'verbose_name_plural': 'Classrooms',
            },
        ),
        migrations.CreateModel(
            name='Note',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=100)),
                ('file', models.FileField(upload_to=classroom.models.upload_notes_file)),
                ('classroom_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='classroom.Classroom')),
                ('teacher_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owns_notes', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='JoinQueue',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('classroom_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pending_requests', to='classroom.Classroom')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ClassroomStudents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('classroom_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='classroom_students', to='classroom.Classroom')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='joined_classrooms', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='AssignmentSubmission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to=classroom.models.upload_submission_file)),
                ('marks', models.PositiveIntegerField()),
                ('assignment_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assignment_submissions', to='classroom.Assignment')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submitted_solutions', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='assignment',
            name='classroom_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assignments', to='classroom.Classroom'),
        ),
        migrations.AddField(
            model_name='assignment',
            name='teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owns_assignment', to=settings.AUTH_USER_MODEL),
        ),
    ]
コード例 #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('is_student', models.BooleanField(default=False)),
                ('is_teacher', models.BooleanField(default=False)),
                ('establishment', models.CharField(max_length=50)),
                ('bio', models.CharField(max_length=400)),
                ('profile_pic',
                 models.ImageField(default='default.jpg',
                                   upload_to=classroom.models.wrapperuser)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=60)),
                ('content', models.CharField(max_length=500)),
                ('date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Quizz',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('author',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=15)),
                ('description', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='TakenQuizz',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('score', models.FloatField()),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('quizz',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='classroom.Quizz')),
                ('student',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='classroom.Student')),
            ],
        ),
        migrations.AddField(
            model_name='student',
            name='interests',
            field=models.ManyToManyField(to='classroom.Subject'),
        ),
        migrations.AddField(
            model_name='student',
            name='quizzez',
            field=models.ManyToManyField(to='classroom.Quizz'),
        ),
        migrations.AddField(
            model_name='student',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='quizz',
            name='subject',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='classroom.Subject'),
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.CharField(max_length=200)),
                ('quizz',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='classroom.Quizz')),
            ],
        ),
        migrations.CreateModel(
            name='Answer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.CharField(max_length=100)),
                ('is_correct', models.BooleanField(default=False)),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='classroom.Question')),
            ],
        ),
    ]
コード例 #9
0
ファイル: 0001_initial.py プロジェクト: sumit2312/i_attend
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('is_student', models.BooleanField(default=False)),
                ('is_teacher', models.BooleanField(default=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='StudentDetails',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('branch',
                 models.CharField(choices=[
                     ('Information_Technology', 'Information_Technology'),
                     ('Computer_Science_an_ Engineering',
                      'Computer_Science_and_Engineering'),
                     ('Electronics_and_Electrical_Engineering',
                      'Electronics_and_Electrical_Engineering'),
                     ('Mining', 'Mining')
                 ],
                                  max_length=50)),
                ('semester', models.IntegerField()),
                ('image',
                 models.ImageField(
                     upload_to=classroom.models.student_directory_path)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='AttendanceRecord',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('branch',
                 models.CharField(choices=[
                     ('Information_Technology', 'Information_Technology'),
                     ('Computer_Science_an_ Engineering',
                      'Computer_Science_and_Engineering'),
                     ('Electronics_and_Electrical_Engineering',
                      'Electronics_and_Electrical_Engineering'),
                     ('Mining', 'Mining')
                 ],
                                  max_length=50)),
                ('semester', models.IntegerField()),
                ('date', models.DateField()),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='classroom.StudentDetails')),
                ('teacher',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject', models.CharField(max_length=50)),
                ('branch',
                 models.CharField(choices=[
                     ('Information_Technology', 'Information_Technology'),
                     ('Computer_Science_an_ Engineering',
                      'Computer_Science_and_Engineering'),
                     ('Electronics_and_Electrical_Engineering',
                      'Electronics_and_Electrical_Engineering'),
                     ('Mining', 'Mining')
                 ],
                                  max_length=50)),
                ('semester', models.IntegerField()),
                ('image',
                 models.ImageField(
                     upload_to=classroom.models.teacher_directory_path)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('is_student', models.BooleanField(default=False)),
                ('is_teacher', models.BooleanField(default=False)),
                ('is_reviewer', models.BooleanField(default=False)),
                ('image',
                 models.ImageField(
                     default='user.png',
                     upload_to=classroom.models.user_directory_path)),
                ('phone_number',
                 models.CharField(blank=True,
                                  max_length=17,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          regex='^\\+?1?\\d{9,15}$')
                                  ])),
                ('assigned_projects', models.IntegerField(default=0)),
            ],
            options={
                'verbose_name_plural': 'users',
                'verbose_name': 'user',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('author', models.CharField(max_length=200)),
                ('text', models.TextField()),
                ('created_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('cls',
                 models.CharField(choices=[('a', 'B. Tech'), ('b', 'M. Tech'),
                                           ('c', 'MCA'), ('d', 'PhD')],
                                  max_length=1)),
                ('semester',
                 models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'),
                                           ('4', '4'), ('5', '5'), ('6', '6'),
                                           ('7', '7'), ('8', '8')],
                                  max_length=1)),
                ('department',
                 models.CharField(choices=[
                     ('a', 'Department of Computer Science and Engineering'),
                     ('b', 'Department of Information Technology'),
                     ('c',
                      'Department of Electronics & Communication Engineering'),
                     ('d',
                      'Department of Electrical and Electronics Engineering'),
                     ('e', 'Department of Mechanical Engineering'),
                     ('f', 'Department of Civil Engineering'),
                     ('g',
                      'Department of Mathematical and Computational Sciences'),
                     ('h', 'Department of Mining Engineering'),
                     ('i', 'Department of Chemical Engineering'),
                     ('j',
                      'Department of Metallurgical and Materials Engineering'),
                     ('k', 'Department of Applied Mechanics and Hydraulics'),
                     ('l', 'Department of Physics'),
                     ('m', 'Department of Chemistry'),
                     ('n', 'Department of Placement and Training'),
                     ('o', 'School of Management')
                 ],
                                  max_length=1)),
                ('info', models.TextField(max_length=100000)),
                ('project_details',
                 models.TextField(default='', max_length=1000000)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=500)),
                ('members', models.CharField(max_length=200)),
                ('idea', models.TextField(default='', max_length=1000000)),
                ('review', models.TextField(default='', max_length=1000000)),
                ('marks_assigned', models.BooleanField(default=False)),
                ('marks', models.IntegerField(default=0)),
                ('courseid', models.IntegerField(default=0)),
                ('is_assigned', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Report',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file', models.FileField(upload_to='uploads/')),
                ('projectid', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='project',
            name='owner',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='projects',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='project',
            name='reviewee',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='reviewer_projects',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='course',
            name='owner',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='courses',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='comment',
            name='project',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='comments',
                to='classroom.Project'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='teacher',
            name='courses',
            field=models.ManyToManyField(related_name='my_courses',
                                         to='classroom.Course'),
        ),
        migrations.AddField(
            model_name='student',
            name='projects',
            field=models.ManyToManyField(related_name='myprojects',
                                         to='classroom.Project'),
        ),
    ]
コード例 #11
0
class Migration(migrations.Migration):

    dependencies = [
        ('classroom', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('author', models.CharField(max_length=200)),
                ('text', models.TextField()),
                ('created_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('cls',
                 models.CharField(choices=[('a', 'B. Tech'), ('b', 'M. Tech'),
                                           ('c', 'MCA'), ('d', 'PhD')],
                                  max_length=1)),
                ('semester',
                 models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'),
                                           ('4', '4'), ('5', '5'), ('6', '6'),
                                           ('7', '7'), ('8', '8')],
                                  max_length=1)),
                ('department',
                 models.CharField(choices=[
                     ('a', 'Department of Computer Science and Engineering'),
                     ('b', 'Department of Information Technology'),
                     ('c',
                      'Department of Electronics & Communication Engineering'),
                     ('d',
                      'Department of Electrical and Electronics Engineering'),
                     ('e', 'Department of Mechanical Engineering'),
                     ('f', 'Department of Civil Engineering'),
                     ('g',
                      'Department of Mathematical and Computational Sciences'),
                     ('h', 'Department of Mining Engineering'),
                     ('i', 'Department of Chemical Engineering'),
                     ('j',
                      'Department of Metallurgical and Materials Engineering'),
                     ('k', 'Department of Applied Mechanics and Hydraulics'),
                     ('l', 'Department of Physics'),
                     ('m', 'Department of Chemistry'),
                     ('n', 'Department of Placement and Training'),
                     ('o', 'School of Management')
                 ],
                                  max_length=1)),
                ('info', models.CharField(max_length=100000)),
                ('project_details',
                 models.CharField(default='', max_length=1000000)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=500)),
                ('members', models.CharField(max_length=200)),
                ('idea', models.CharField(default='', max_length=1000000)),
                ('review', models.CharField(default='', max_length=1000000)),
                ('marks_assigned', models.BooleanField(default=False)),
                ('marks', models.IntegerField(default=0)),
                ('courseid', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('courses',
                 models.ManyToManyField(related_name='my_courses',
                                        to='classroom.Course')),
            ],
        ),
        migrations.RemoveField(
            model_name='answer',
            name='question',
        ),
        migrations.RemoveField(
            model_name='question',
            name='quiz',
        ),
        migrations.RemoveField(
            model_name='quiz',
            name='owner',
        ),
        migrations.RemoveField(
            model_name='quiz',
            name='subject',
        ),
        migrations.RemoveField(
            model_name='studentanswer',
            name='answer',
        ),
        migrations.RemoveField(
            model_name='studentanswer',
            name='student',
        ),
        migrations.RemoveField(
            model_name='takenquiz',
            name='quiz',
        ),
        migrations.RemoveField(
            model_name='takenquiz',
            name='student',
        ),
        migrations.RemoveField(
            model_name='student',
            name='interests',
        ),
        migrations.RemoveField(
            model_name='student',
            name='quizzes',
        ),
        migrations.AddField(
            model_name='user',
            name='assigned_projects',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='user',
            name='image',
            field=models.ImageField(
                default='user.png',
                upload_to=classroom.models.user_directory_path),
        ),
        migrations.AddField(
            model_name='user',
            name='is_reviewer',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='user',
            name='phone_number',
            field=models.CharField(blank=True,
                                   max_length=17,
                                   validators=[
                                       django.core.validators.RegexValidator(
                                           regex='^\\+?1?\\d{9,15}$')
                                   ]),
        ),
        migrations.DeleteModel(name='Answer', ),
        migrations.DeleteModel(name='Question', ),
        migrations.DeleteModel(name='Quiz', ),
        migrations.DeleteModel(name='StudentAnswer', ),
        migrations.DeleteModel(name='Subject', ),
        migrations.DeleteModel(name='TakenQuiz', ),
        migrations.AddField(
            model_name='project',
            name='owner',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='projects',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='project',
            name='reviewee',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='reviewer_projects',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='course',
            name='owner',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='courses',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='comment',
            name='project',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='comments',
                to='classroom.Project'),
        ),
        migrations.AddField(
            model_name='student',
            name='projects',
            field=models.ManyToManyField(related_name='myprojects',
                                         to='classroom.Project'),
        ),
    ]
コード例 #12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('firstname', models.CharField(max_length=20)),
                ('lastname', models.CharField(max_length=20)),
                ('account_type',
                 models.CharField(choices=[('Student', 'Student'),
                                           ('Faculty', 'Faculty')],
                                  max_length=20)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('content', models.TextField(default='')),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('due_date', models.DateTimeField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('files',
                 models.FileField(upload_to=classroom.models.submission_path)),
                ('assignment',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='submissions',
                                   to='classroom.Assignment')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='submissions',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('info', models.TextField(blank=True)),
                ('code', models.CharField(max_length=6)),
                ('date_created',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('faculties',
                 models.ManyToManyField(related_name='subjects',
                                        to=settings.AUTH_USER_MODEL)),
                ('students',
                 models.ManyToManyField(related_name='courses',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PostComment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('post',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='classroom.Post')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='postcomments',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.AddField(
            model_name='post',
            name='subject',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='posts',
                to='classroom.Subject'),
        ),
        migrations.AddField(
            model_name='post',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='posts',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Note',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=15)),
                ('content', models.TextField()),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('starred', models.BooleanField(default=False)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='notes',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('closing_time', models.DateTimeField()),
                ('students',
                 models.ManyToManyField(related_name='attendance',
                                        to=settings.AUTH_USER_MODEL)),
                ('subject',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attendances',
                                   to='classroom.Subject')),
            ],
        ),
        migrations.AddField(
            model_name='assignment',
            name='subject',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='assignments',
                to='classroom.Subject'),
        ),
        migrations.AddField(
            model_name='assignment',
            name='submitted_students',
            field=models.ManyToManyField(related_name='submitted',
                                         to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='assignment',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='created_assigns',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='AssignComment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
                ('assignment',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='classroom.Assignment')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='assigncomments',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]