X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/068d95bd6f8b28031a9e5236dbec460aad44ae7a..cb238bf65280df57db6158d437853475af4f2e18:/wtem/models.py?ds=inline diff --git a/wtem/models.py b/wtem/models.py index 4c91392..8e9d505 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' @@ -21,6 +26,7 @@ class Submission(models.Model): answers = models.CharField(max_length = 65536, null = True, blank = True) key_sent = models.BooleanField(default = False) marks = JSONField() + examiners = models.ManyToManyField(User, null = True, blank = True) def __unicode__(self): return ', '.join((self.last_name, self.first_name, self.email)) @@ -66,7 +72,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')