summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 79732cc..87e6260 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -78,9 +78,10 @@ test_status = (
def get_assignment_dir(instance, filename):
+ upload_dir = instance.question_paper.quiz.description.replace(" ", "_")
return os.sep.join((
- instance.question_paper.quiz.description, instance.user.username,
- str(instance.assignmentQuestion.id), filename
+ upload_dir, instance.user.username, str(instance.assignmentQuestion.id),
+ filename
))
@@ -305,6 +306,9 @@ class Profile(models.Model):
os.chmod(user_dir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
return user_dir
+ def __str__(self):
+ return '%s' % (self.user.get_full_name())
+
###############################################################################
class Question(models.Model):