From 13670d7c5ad6e73d32f359355444ba6e3f19e861 Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Wed, 20 Jan 2016 02:23:12 +0000 Subject: [PATCH 1/5] Create Django migrations, deprecate South. --- problem_builder/migrations/0001_initial.py | 29 ++++++++++++++++++++++ problem_builder/migrations/__init__.py | 0 2 files changed, 29 insertions(+) create mode 100644 problem_builder/migrations/0001_initial.py create mode 100644 problem_builder/migrations/__init__.py diff --git a/problem_builder/migrations/0001_initial.py b/problem_builder/migrations/0001_initial.py new file mode 100644 index 00000000..2b3f6085 --- /dev/null +++ b/problem_builder/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Answer', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=50, db_index=True)), + ('student_id', models.CharField(max_length=32, db_index=True)), + ('course_id', models.CharField(max_length=50, db_index=True)), + ('student_input', models.TextField(default=b'', blank=True)), + ('created_on', models.DateTimeField(auto_now_add=True, verbose_name=b'created on')), + ('modified_on', models.DateTimeField(auto_now=True, verbose_name=b'modified on')), + ], + ), + migrations.AlterUniqueTogether( + name='answer', + unique_together=set([('student_id', 'course_id', 'name')]), + ), + ] diff --git a/problem_builder/migrations/__init__.py b/problem_builder/migrations/__init__.py new file mode 100644 index 00000000..e69de29b From 64cbd3e757b2cdb836626d0cefaa6b76418857fd Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Thu, 21 Jan 2016 20:24:07 +0000 Subject: [PATCH 2/5] Move old migrations into south_migrations. --- problem_builder/{migrations => south_migrations}/0001_initial.py | 0 .../{migrations => south_migrations}/0002_copy_from_mentoring.py | 0 ..._add_share__add_unique_share_shared_by_shared_with_block_id.py | 0 problem_builder/{migrations => south_migrations}/__init__.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename problem_builder/{migrations => south_migrations}/0001_initial.py (100%) rename problem_builder/{migrations => south_migrations}/0002_copy_from_mentoring.py (100%) rename problem_builder/{migrations => south_migrations}/0003_auto__add_share__add_unique_share_shared_by_shared_with_block_id.py (100%) rename problem_builder/{migrations => south_migrations}/__init__.py (100%) diff --git a/problem_builder/migrations/0001_initial.py b/problem_builder/south_migrations/0001_initial.py similarity index 100% rename from problem_builder/migrations/0001_initial.py rename to problem_builder/south_migrations/0001_initial.py diff --git a/problem_builder/migrations/0002_copy_from_mentoring.py b/problem_builder/south_migrations/0002_copy_from_mentoring.py similarity index 100% rename from problem_builder/migrations/0002_copy_from_mentoring.py rename to problem_builder/south_migrations/0002_copy_from_mentoring.py diff --git a/problem_builder/migrations/0003_auto__add_share__add_unique_share_shared_by_shared_with_block_id.py b/problem_builder/south_migrations/0003_auto__add_share__add_unique_share_shared_by_shared_with_block_id.py similarity index 100% rename from problem_builder/migrations/0003_auto__add_share__add_unique_share_shared_by_shared_with_block_id.py rename to problem_builder/south_migrations/0003_auto__add_share__add_unique_share_shared_by_shared_with_block_id.py diff --git a/problem_builder/migrations/__init__.py b/problem_builder/south_migrations/__init__.py similarity index 100% rename from problem_builder/migrations/__init__.py rename to problem_builder/south_migrations/__init__.py From d2dbe3b863418c10739e94d16e7f2a6f12c52524 Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Thu, 21 Jan 2016 20:30:06 +0000 Subject: [PATCH 3/5] Add in Django migration for shares. --- .../migrations/0002_auto_20160121_1525.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 problem_builder/migrations/0002_auto_20160121_1525.py diff --git a/problem_builder/migrations/0002_auto_20160121_1525.py b/problem_builder/migrations/0002_auto_20160121_1525.py new file mode 100644 index 00000000..65c7e0ed --- /dev/null +++ b/problem_builder/migrations/0002_auto_20160121_1525.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('problem_builder', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Share', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('submission_uid', models.CharField(max_length=32)), + ('block_id', models.CharField(max_length=255, db_index=True)), + ('notified', models.BooleanField(default=False, db_index=True)), + ('shared_by', models.ForeignKey(related_name='problem_builder_shared_by', to=settings.AUTH_USER_MODEL)), + ('shared_with', models.ForeignKey(related_name='problem_builder_shared_with', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AlterUniqueTogether( + name='share', + unique_together=set([('shared_by', 'shared_with', 'block_id')]), + ), + ] From 86f86e242e951aca6b200897a80badee7337c81f Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Fri, 22 Jan 2016 19:32:21 +0000 Subject: [PATCH 4/5] Bump XBlock utils in requirements.txt. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ce2cb574..dcd4747f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ ddt mock unicodecsv==0.9.4 --e git+https://github.com/edx/xblock-utils.git@b4f9b51146c7fafa12f41d54af752b8f1516dffd#egg=xblock-utils +-e git+https://github.com/edx/xblock-utils.git@v1.0.2#egg=xblock-utils -e . From 910114ca3ea7c86c5548c5dd92968e867f69d13c Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Mon, 25 Jan 2016 14:19:33 +0000 Subject: [PATCH 5/5] Remove migrations from pylint/pep8; remove 'include-ids', which is deprecated. --- .pep8 | 2 ++ pylintrc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .pep8 diff --git a/.pep8 b/.pep8 new file mode 100644 index 00000000..f8931cdd --- /dev/null +++ b/.pep8 @@ -0,0 +1,2 @@ +[pep8] +exclude=problem_builder/migrations diff --git a/pylintrc b/pylintrc index 29296376..539afab9 100644 --- a/pylintrc +++ b/pylintrc @@ -1,6 +1,8 @@ +[MASTER] +ignore=problem_builder/migrations + [REPORTS] reports=no -include-ids=yes [FORMAT] max-line-length=120