X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/068d95bd6f8b28031a9e5236dbec460aad44ae7a..ecf1bb43a75eeacf9dbec78fd6f5a1d3d526dbd8:/wtem/models.py?ds=sidebyside diff --git a/wtem/models.py b/wtem/models.py index 4c91392..1cd87f9 100644 --- a/wtem/models.py +++ b/wtem/models.py @@ -1,14 +1,19 @@ import random import string +import os from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError +from django.utils import simplejson from django.utils.translation import ugettext as _ from jsonfield import JSONField from contact.models import Contact +f = file(os.path.dirname(__file__) + '/fixtures/exercises.json') +exercises = simplejson.loads(f.read()) +f.close() DEBUG_KEY = '12345' @@ -66,7 +71,7 @@ class Submission(models.Model): class Attachment(models.Model): submission = models.ForeignKey(Submission) - name = models.CharField(max_length=100) + exercise_id = models.IntegerField() file = models.FileField(upload_to = 'wtem/attachment')