Commit 5df51bd3 by Clinton Blackburn

Upgraded to Django 1.7

parent 1a0cd5bb
......@@ -62,7 +62,10 @@ disable=
# E1103: maybe no member
E1103,
# C0111: missing docstring (handled by pep257)
C0111
C0111,
# We can decide if names are invalid on our own
invalid-name,
[REPORTS]
......
......@@ -4,7 +4,7 @@ COVERAGE = $(ROOT)/build/coverage
PACKAGES = analyticsdataserver analytics_data_api
DATABASES = default analytics
.PHONY: requirements develop clean diff.report view.diff.report quality syncdb
.PHONY: requirements develop clean diff.report view.diff.report quality migrate
requirements:
pip install -q -r requirements/base.txt
......@@ -46,10 +46,10 @@ quality:
validate: test.requirements test quality
syncdb:
$(foreach db_name,$(DATABASES),./manage.py syncdb --migrate --noinput --database=$(db_name);)
migrate:
$(foreach db_name,$(DATABASES),./manage.py migrate --noinput --database=$(db_name);)
loaddata: syncdb
loaddata: migrate
python manage.py loaddata education_levels problem_response_answer_distribution --database=analytics
python manage.py generate_fake_course_data
......
......@@ -19,8 +19,8 @@ Getting Started
2. Setup the databases:
$ ./manage.py syncdb --migrate --noinput
$ ./manage.py syncdb --migrate --noinput --database=analytics
$ ./manage.py migrate --noinput
$ ./manage.py migrate --noinput --database=analytics
3. Create a user and authentication token. Note that the user will be created if one does not exist.
......
......@@ -2,12 +2,15 @@
from optparse import make_option
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from analytics_data_api.utils import delete_user_auth_token, set_user_auth_token
User = get_user_model()
class Command(BaseCommand):
"""A command to set the API key for a user using when using TokenAuthentication."""
......@@ -30,6 +33,7 @@ class Command(BaseCommand):
if len(args) < 2:
raise CommandError("You must supply both a username and key.")
# pylint: disable=no-member
user, _ = User.objects.get_or_create(username=username)
try:
......
......@@ -89,7 +89,7 @@ class ProblemResponseAnswerDistribution(models.Model):
course_id = models.CharField(db_index=True, max_length=255, db_column='course_id')
module_id = models.CharField(db_index=True, max_length=255, db_column='module_id')
part_id = models.CharField(db_index=True, max_length=255, db_column='part_id')
correct = models.BooleanField(db_column='correct')
correct = models.NullBooleanField(db_column='correct')
count = models.IntegerField(db_column='count')
value_id = models.CharField(db_index=True, max_length=255, db_column='value_id', null=True)
answer_value_text = models.TextField(db_column='answer_value_text', null=True)
......
......@@ -181,7 +181,6 @@ DJANGO_APPS = (
)
THIRD_PARTY_APPS = (
'south',
'rest_framework',
'rest_framework.authtoken',
'rest_framework_swagger',
......
Django==1.6.6 # BSD License
Django==1.7 # BSD License
Markdown==2.4.1 # BSD
South==1.0 # Apache License
django-model-utils==1.4.0 # BSD
djangorestframework==2.3.5 # BSD
ipython==2.1.0 # BSD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment