diff --git a/src/account/migrations/0001_initial.py b/src/account/migrations/0001_initial.py index 8a477bdaf4bec82fb83708e8b1e1d314a1318004..10c1415fab7a219189d6dd4338d89ca2ba0c7d5d 100644 --- a/src/account/migrations/0001_initial.py +++ b/src/account/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.0.1 on 2019-01-17 15:06 +# Generated by Django 2.2.4 on 2020-02-04 14:16 from django.conf import settings from django.db import migrations, models @@ -17,9 +17,10 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Deadline', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('deadline', models.DateTimeField(null=True)), + ('messageBefore', models.TextField(blank=True, default='')), + ('messageAfter', models.TextField(blank=True, default='')), ], options={ 'abstract': False, @@ -28,17 +29,14 @@ class Migration(migrations.Migration): migrations.CreateModel( name='GroupChoice', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), - ('choice', models.CharField(choices=[('DT', 'DevTeam'), ('NET', 'NeTeam'), ('ST', 'SecurITeam'), ( - 'SYS', 'SysAdmin'), ('HAT', 'HallgatĂłi TudĂĄsbĂĄzis'), ('N', 'None')], default='N', max_length=10, unique=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('choice', models.CharField(choices=[('DT', 'DevTeam'), ('NET', 'NeTeam'), ('ST', 'SecurITeam'), ('SYS', 'SysAdmin'), ('HAT', 'HallgatĂłi TudĂĄsbĂĄzis'), ('N', 'None')], default='N', max_length=10, unique=True)), ], ), migrations.CreateModel( name='Profile', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('join_date', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('motivation_about', models.TextField(blank=True, default='')), @@ -46,12 +44,9 @@ class Migration(migrations.Migration): ('motivation_exercise', models.TextField(blank=True, default='')), ('nick', models.CharField(blank=True, default='', max_length=15)), ('signed', models.BooleanField(default=False)), - ('role', models.CharField(choices=[('Staff', 'Staff'), ('Applicant', 'Applicant'), ( - 'Student', 'Student')], default='Applicant', max_length=10)), - ('groups', models.ManyToManyField(blank=True, - related_name='profiles', to='account.GroupChoice')), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, - related_name='profile', to=settings.AUTH_USER_MODEL)), + ('role', models.CharField(choices=[('Staff', 'Staff'), ('Applicant', 'Applicant'), ('Student', 'Student'), ('Denied', 'Denied')], default='Applicant', max_length=10)), + ('groups', models.ManyToManyField(blank=True, related_name='profiles', to='account.GroupChoice')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)), ], ), ] diff --git a/src/account/migrations/0002_auto_20190122_1341.py b/src/account/migrations/0002_auto_20190122_1341.py deleted file mode 100644 index bb010a2b47f77be10ce101b4ad90d4d3fe403341..0000000000000000000000000000000000000000 --- a/src/account/migrations/0002_auto_20190122_1341.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-22 12:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='profile', - name='role', - field=models.CharField(choices=[('Staff', 'Staff'), ('Applicant', 'Applicant'), ( - 'Student', 'Student'), ('Denied', 'Denied')], default='Applicant', max_length=10), - ), - ] diff --git a/src/account/migrations/0003_auto_20200202_1541.py b/src/account/migrations/0003_auto_20200202_1541.py deleted file mode 100644 index fdfda988e7024d3f03516a0594b5c9d9ffaa1cc6..0000000000000000000000000000000000000000 --- a/src/account/migrations/0003_auto_20200202_1541.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 14:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0002_auto_20190122_1341'), - ] - - operations = [ - migrations.AddField( - model_name='deadline', - name='text', - field=models.CharField(blank=True, default='', max_length=50), - ), - migrations.AddField( - model_name='profile', - name='image', - field=models.ImageField( - blank=True, null=True, upload_to='accounts/images/'), - ), - ] diff --git a/src/account/migrations/0004_remove_profile_image.py b/src/account/migrations/0004_remove_profile_image.py deleted file mode 100644 index c2ae802dc74683eb7459aa87924d7549b95a1867..0000000000000000000000000000000000000000 --- a/src/account/migrations/0004_remove_profile_image.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 14:42 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0003_auto_20200202_1541'), - ] - - operations = [ - migrations.RemoveField( - model_name='profile', - name='image', - ), - ] diff --git a/src/account/migrations/0005_auto_20200202_2058.py b/src/account/migrations/0005_auto_20200202_2058.py deleted file mode 100644 index 6b3709a1b1fc478cc5dfada933b7dccfd5c6cc1f..0000000000000000000000000000000000000000 --- a/src/account/migrations/0005_auto_20200202_2058.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 19:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0004_remove_profile_image'), - ] - - operations = [ - migrations.AlterField( - model_name='deadline', - name='text', - field=models.TextField(blank=True, default=''), - ), - ] diff --git a/src/account/migrations/0006_auto_20200202_2100.py b/src/account/migrations/0006_auto_20200202_2100.py deleted file mode 100644 index 1f76a1f847c2fd28b0dc4dbb12c7af832b7734fd..0000000000000000000000000000000000000000 --- a/src/account/migrations/0006_auto_20200202_2100.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 20:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0005_auto_20200202_2058'), - ] - - operations = [ - migrations.RenameField( - model_name='deadline', - old_name='text', - new_name='messageAfter', - ), - migrations.AddField( - model_name='deadline', - name='messageBefore', - field=models.TextField(blank=True, default=''), - ), - ] diff --git a/src/common/middleware.py b/src/common/middleware.py deleted file mode 100644 index 82f040c15458facfd7e6603558465825b2dc4c4a..0000000000000000000000000000000000000000 --- a/src/common/middleware.py +++ /dev/null @@ -1,19 +0,0 @@ -from threading import local - -_profile = local() - - -class CurrentUserMiddleware(object): - - def __init__(self, get_response): - self.get_response = get_response - - def __call__(self, request): - _profile.value = request.user - return self.get_response(request) - - def get_current_user_profile(): - return _profile.value.profile - - def get_current_user(): - return _profile.value diff --git a/src/document/migrations/0001_initial.py b/src/document/migrations/0001_initial.py index 7b6f640281ba41f95d5d03c76db5308c453ec343..f40f0e7e4a8d42373f06d0b01ce63b3a6f730cf8 100644 --- a/src/document/migrations/0001_initial.py +++ b/src/document/migrations/0001_initial.py @@ -1,6 +1,5 @@ -# Generated by Django 2.2.4 on 2020-02-02 15:10 +# Generated by Django 2.2.4 on 2020-02-04 14:16 -import common.middleware import common.validators import django.core.validators from django.db import migrations, models @@ -13,25 +12,21 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('account', '0004_remove_profile_image'), - ('homework', '0003_auto_20200202_1541'), + ('homework', '0001_initial'), + ('account', '0001_initial'), ] operations = [ migrations.CreateModel( name='Document', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uploaded_at', models.DateTimeField(auto_now_add=True)), ('name', models.CharField(blank=True, default='', max_length=150)), ('description', models.TextField(blank=True, default='')), - ('file', models.FileField(blank=True, null=True, upload_to=document.models.document_file_name, validators=[ - django.core.validators.FileExtensionValidator(['png', 'jpeg', 'jpg', 'zip']), common.validators.FileSizeValidator(size_limit=52428800)])), - ('solution', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, - related_name='files', to='homework.Solution')), - ('uploaded_by', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='documents', to='account.Profile')), + ('file', models.FileField(blank=True, null=True, upload_to=document.models.document_file_name, validators=[django.core.validators.FileExtensionValidator(['png', 'jpeg', 'jpg', 'zip']), common.validators.FileSizeValidator(size_limit=52428800)])), + ('solution', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='homework.Solution')), + ('uploaded_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='documents', to='account.Profile')), ], ), ] diff --git a/src/document/migrations/0002_auto_20190121_1332.py b/src/document/migrations/0002_auto_20190121_1332.py deleted file mode 100644 index 3e91175e44049fa5517660e8ef19e1b32e3c5c0b..0000000000000000000000000000000000000000 --- a/src/document/migrations/0002_auto_20190121_1332.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-21 12:32 - -import common.validators -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('document', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='file', - field=models.FileField(blank=True, default='', upload_to='', validators=[django.core.validators.FileExtensionValidator( - ['png', 'jpeg', 'jpg', 'zip']), common.validators.FileSizeValidator(size_limit=52428800)]), - ), - ] diff --git a/src/document/migrations/0003_auto_20190121_1335.py b/src/document/migrations/0003_auto_20190121_1335.py deleted file mode 100644 index fe059ec31970f9fb4186389c5a021ad771e20c7a..0000000000000000000000000000000000000000 --- a/src/document/migrations/0003_auto_20190121_1335.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-21 12:35 - -import common.validators -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('document', '0002_auto_20190121_1332'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='file', - field=models.FileField(blank=True, upload_to='', validators=[django.core.validators.FileExtensionValidator( - ['png', 'jpeg', 'jpg', 'zip']), common.validators.FileSizeValidator(size_limit=52428800)]), - ), - ] diff --git a/src/document/migrations/0004_auto_20190123_1812.py b/src/document/migrations/0004_auto_20190123_1812.py deleted file mode 100644 index 95a9a1c5acf4b94783ffc434dc6b10c52c2cb560..0000000000000000000000000000000000000000 --- a/src/document/migrations/0004_auto_20190123_1812.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-23 17:12 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('document', '0003_auto_20190121_1335'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='solution', - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, related_name='files', to='homework.Solution'), - ), - ] diff --git a/src/document/migrations/0005_auto_20190129_1438.py b/src/document/migrations/0005_auto_20190129_1438.py deleted file mode 100644 index da8acfc706738e46cd96842231f34d7510febf0d..0000000000000000000000000000000000000000 --- a/src/document/migrations/0005_auto_20190129_1438.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-29 13:38 - -import common.validators -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('document', '0004_auto_20190123_1812'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='file', - field=models.FileField(blank=True, null=True, upload_to='', validators=[django.core.validators.FileExtensionValidator( - ['png', 'jpeg', 'jpg', 'zip']), common.validators.FileSizeValidator(size_limit=52428800)]), - ), - migrations.AlterField( - model_name='document', - name='name', - field=models.CharField(blank=True, default='', max_length=150), - ), - ] diff --git a/src/document/migrations/0006_auto_20200203_0016.py b/src/document/migrations/0006_auto_20200203_0016.py deleted file mode 100644 index a8e13ced35131bd48da645e5f838e32128d66f90..0000000000000000000000000000000000000000 --- a/src/document/migrations/0006_auto_20200203_0016.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 23:16 - -import common.validators -import django.core.validators -from django.db import migrations, models -import document.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('document', '0005_auto_20190129_1438'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='file', - field=models.FileField(blank=True, null=True, upload_to=document.models.document_file_name, validators=[ - django.core.validators.FileExtensionValidator(['png', 'jpeg', 'jpg', 'zip']), common.validators.FileSizeValidator(size_limit=52428800)]), - ), - ] diff --git a/src/document/migrations/0007_auto_20200204_1442.py b/src/document/migrations/0007_auto_20200204_1442.py deleted file mode 100644 index ede8e1160ad33290df6ff389ce011708c447485e..0000000000000000000000000000000000000000 --- a/src/document/migrations/0007_auto_20200204_1442.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-04 13:42 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('document', '0006_auto_20200203_0016'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='uploaded_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='documents', to='account.Profile'), - ), - ] diff --git a/src/homework/migrations/0001_initial.py b/src/homework/migrations/0001_initial.py index d41fc713789e4f4d5a5bcabbe20854da9b411b5c..562d226240a20d19ece2eb84f0586b9fc50976cd 100644 --- a/src/homework/migrations/0001_initial.py +++ b/src/homework/migrations/0001_initial.py @@ -1,6 +1,5 @@ -# Generated by Django 2.0.1 on 2019-01-17 15:06 +# Generated by Django 2.2.4 on 2020-02-04 14:16 -import common.middleware from django.db import migrations, models import django.db.models.deletion @@ -15,37 +14,29 @@ class Migration(migrations.Migration): operations = [ migrations.CreateModel( - name='Solution', + name='Task', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), - ('note', models.TextField(blank=True, default='')), - ('accepted', models.BooleanField()), - ('corrected', models.BooleanField()), - ('created_by', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='solution', to='account.Profile')), + ('title', models.CharField(max_length=150)), + ('text', models.TextField()), + ('deadline', models.DateTimeField()), + ('bits', models.IntegerField(default=1)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tasks', to='account.Profile')), ], ), migrations.CreateModel( - name='Task', + name='Solution', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), - ('title', models.CharField(max_length=150)), - ('text', models.TextField()), - ('deadline', models.DateTimeField()), - ('created_by', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='tasks', to='account.Profile')), + ('note', models.TextField(blank=True, default='')), + ('accepted', models.BooleanField(blank=True, default=False)), + ('corrected', models.BooleanField(blank=True, default=False)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='solution', to='account.Profile')), + ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='solutions', to='homework.Task')), ], ), - migrations.AddField( - model_name='solution', - name='task', - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, related_name='solutions', to='homework.Task'), - ), ] diff --git a/src/homework/migrations/0002_auto_20190121_2124.py b/src/homework/migrations/0002_auto_20190121_2124.py deleted file mode 100644 index 3abf5a83e87d8424a882e3c92f55af2f1478d3ee..0000000000000000000000000000000000000000 --- a/src/homework/migrations/0002_auto_20190121_2124.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-21 20:24 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('homework', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='solution', - name='accepted', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='solution', - name='corrected', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/homework/migrations/0003_auto_20200202_1541.py b/src/homework/migrations/0003_auto_20200202_1541.py deleted file mode 100644 index 63c588fd04eb2f2543ccf90ebe3237fa69cc48aa..0000000000000000000000000000000000000000 --- a/src/homework/migrations/0003_auto_20200202_1541.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 14:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('homework', '0002_auto_20190121_2124'), - ] - - operations = [ - migrations.AddField( - model_name='task', - name='bits', - field=models.IntegerField(default=1), - ), - migrations.AlterField( - model_name='solution', - name='accepted', - field=models.BooleanField(blank=True, default=False), - ), - migrations.AlterField( - model_name='solution', - name='corrected', - field=models.BooleanField(blank=True, default=False), - ), - ] diff --git a/src/homework/migrations/0004_auto_20200204_1457.py b/src/homework/migrations/0004_auto_20200204_1457.py deleted file mode 100644 index 6090358865bc28d8cac2e21255058ef866e2942f..0000000000000000000000000000000000000000 --- a/src/homework/migrations/0004_auto_20200204_1457.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-04 13:57 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('homework', '0003_auto_20200202_1541'), - ] - - operations = [ - migrations.AlterField( - model_name='solution', - name='created_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='solution', to='account.Profile'), - ), - migrations.AlterField( - model_name='task', - name='created_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tasks', to='account.Profile'), - ), - ] diff --git a/src/kszkepzes/settings/base.py b/src/kszkepzes/settings/base.py index 0e504cc5dd800885e1a7dc4be93fe4b379502209..5fdbd69e6fe8a3b0ec1ecd0e49c618c354d97836 100644 --- a/src/kszkepzes/settings/base.py +++ b/src/kszkepzes/settings/base.py @@ -61,7 +61,6 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'common.middleware.CurrentUserMiddleware' ] ROOT_URLCONF = 'kszkepzes.urls' diff --git a/src/mentors/migrations/0001_initial.py b/src/mentors/migrations/0001_initial.py index 782fbdc071f8a8ce33a4cb104fa1a87113eed014..0939292fa324326b75466f3c55561f92fbe628ad 100644 --- a/src/mentors/migrations/0001_initial.py +++ b/src/mentors/migrations/0001_initial.py @@ -1,6 +1,5 @@ -# Generated by Django 2.2.4 on 2020-02-02 19:54 +# Generated by Django 2.2.4 on 2020-02-04 14:16 -import common.middleware from django.db import migrations, models import django.db.models.deletion @@ -10,22 +9,19 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('account', '0004_remove_profile_image'), + ('account', '0001_initial'), ] operations = [ migrations.CreateModel( name='Mentor', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ('text', models.TextField()), - ('image', models.ImageField(blank=True, - null=True, upload_to='mentors/images/')), + ('image', models.ImageField(blank=True, null=True, upload_to='mentors/images/')), ('email', models.EmailField(max_length=254)), - ('mentor', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='mentor', to='account.Profile')), + ('mentor', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='mentor', to='account.Profile')), ], ), ] diff --git a/src/mentors/migrations/0002_auto_20200204_1500.py b/src/mentors/migrations/0002_auto_20200204_1500.py deleted file mode 100644 index 2eb444486c10b76fa2e42399a6257887395054f3..0000000000000000000000000000000000000000 --- a/src/mentors/migrations/0002_auto_20200204_1500.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-04 14:00 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('mentors', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='mentor', - name='mentor', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='mentor', to='account.Profile'), - ), - ] diff --git a/src/news/migrations/0001_initial.py b/src/news/migrations/0001_initial.py index 844a7e255bb247a53191d9ce0965ffe77c31fda3..616cde052b50e3c1a7ee94e3d1c817a8d8a54b85 100644 --- a/src/news/migrations/0001_initial.py +++ b/src/news/migrations/0001_initial.py @@ -1,6 +1,5 @@ -# Generated by Django 2.0.1 on 2019-01-17 15:06 +# Generated by Django 2.2.4 on 2020-02-04 14:16 -import common.middleware from django.db import migrations, models import django.db.models.deletion @@ -17,16 +16,13 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Article', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=200)), ('text', models.TextField()), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), - ('author', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='author', to='account.Profile')), - ('updated_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, - related_name='updater', to='account.Profile')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='author', to='account.Profile')), + ('updated_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='updater', to='account.Profile')), ], ), ] diff --git a/src/news/migrations/0002_auto_20200202_1541.py b/src/news/migrations/0002_auto_20200202_1541.py deleted file mode 100644 index ecd6a503a7f89050469a3d651eeacd1316b78867..0000000000000000000000000000000000000000 --- a/src/news/migrations/0002_auto_20200202_1541.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-02 14:41 - -import common.middleware -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('news', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='article', - name='updated_by', - field=models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='updater', to='account.Profile'), - ), - ] diff --git a/src/news/migrations/0003_auto_20200204_1510.py b/src/news/migrations/0003_auto_20200204_1510.py deleted file mode 100644 index 197ab856dab4ab25514574cef397b31a4e6bfdaa..0000000000000000000000000000000000000000 --- a/src/news/migrations/0003_auto_20200204_1510.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-04 14:10 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('news', '0002_auto_20200202_1541'), - ] - - operations = [ - migrations.AlterField( - model_name='article', - name='author', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='author', to='account.Profile'), - ), - migrations.AlterField( - model_name='article', - name='updated_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='updater', to='account.Profile'), - ), - ] diff --git a/src/stats/migrations/0001_initial.py b/src/stats/migrations/0001_initial.py index 2bc6a35d52517eeec7687ce2bf10da4ffa70b81c..8b549fd6b7a023d2c93664a43881beb02b4871fb 100644 --- a/src/stats/migrations/0001_initial.py +++ b/src/stats/migrations/0001_initial.py @@ -1,6 +1,5 @@ -# Generated by Django 2.0.1 on 2019-01-17 15:06 +# Generated by Django 2.2.4 on 2020-02-04 14:16 -import common.middleware from django.db import migrations, models import django.db.models.deletion @@ -17,32 +16,27 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Event', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255)), ('date', models.DateTimeField()), + ('description', models.TextField(blank=True, default='')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), - ('created_by', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='created_event', to='account.Profile')), - ('visitors', models.ManyToManyField(blank=True, - related_name='events', to='account.Profile')), + ('absent', models.ManyToManyField(blank=True, related_name='events_absent', to='account.Profile')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='created_event', to='account.Profile')), + ('visitors', models.ManyToManyField(blank=True, related_name='events_visitor', to='account.Profile')), ], ), migrations.CreateModel( name='Note', fields=[ - ('id', models.AutoField(auto_created=True, - primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('note', models.TextField()), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), - ('created_by', models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, - on_delete=django.db.models.deletion.DO_NOTHING, related_name='created_notes', to='account.Profile')), - ('event', models.ForeignKey(blank=True, null=True, - on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='stats.Event')), - ('profile', models.ForeignKey(blank=True, null=True, - on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='account.Profile')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='created_notes', to='account.Profile')), + ('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='stats.Event')), + ('profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='account.Profile')), ], ), ] diff --git a/src/stats/migrations/0002_event_description.py b/src/stats/migrations/0002_event_description.py deleted file mode 100644 index d7d056636e1bc6c5ad18457d09a92bc56ba30927..0000000000000000000000000000000000000000 --- a/src/stats/migrations/0002_event_description.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-19 14:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stats', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='description', - field=models.TextField(blank=True, default=''), - ), - ] diff --git a/src/stats/migrations/0003_auto_20190122_1449.py b/src/stats/migrations/0003_auto_20190122_1449.py deleted file mode 100644 index 264620d76494437db53a3fd8629dc4aae72552eb..0000000000000000000000000000000000000000 --- a/src/stats/migrations/0003_auto_20190122_1449.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 2.0.1 on 2019-01-22 13:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0002_auto_20190122_1341'), - ('stats', '0002_event_description'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='absent', - field=models.ManyToManyField( - blank=True, related_name='events_absent', to='account.Profile'), - ), - migrations.AlterField( - model_name='event', - name='visitors', - field=models.ManyToManyField( - blank=True, related_name='events_visitor', to='account.Profile'), - ), - ] diff --git a/src/stats/migrations/0004_auto_20200204_1510.py b/src/stats/migrations/0004_auto_20200204_1510.py deleted file mode 100644 index 72e36a0128dd6695de5356eb8eb4e73384d66c1a..0000000000000000000000000000000000000000 --- a/src/stats/migrations/0004_auto_20200204_1510.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.4 on 2020-02-04 14:10 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stats', '0003_auto_20190122_1449'), - ] - - operations = [ - migrations.AlterField( - model_name='event', - name='created_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='created_event', to='account.Profile'), - ), - migrations.AlterField( - model_name='note', - name='created_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='created_notes', to='account.Profile'), - ), - ]