summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2016-04-27 18:44:18 +0530
committerankitjavalkar2016-05-05 19:19:00 +0530
commit23216995e0fc0e94fd58c6186eed74c943ae5081 (patch)
tree40820b09a5520fc00801f3ab42d57a73ba7b7a06 /yaksh/models.py
parentc557e19470a389aaac569516ed56e1c5b453fd88 (diff)
downloadonline_test-23216995e0fc0e94fd58c6186eed74c943ae5081.tar.gz
online_test-23216995e0fc0e94fd58c6186eed74c943ae5081.tar.bz2
online_test-23216995e0fc0e94fd58c6186eed74c943ae5081.zip
Modify get_form_object method in forms.py
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index b1a53f0..db4b7a8 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -50,6 +50,11 @@ test_status = (
def get_assignment_dir(instance, filename):
return '%s/%s' % (instance.user.roll_number, instance.assignmentQuestion.id)
+def get_model_class(model):
+ ctype = ContentType.objects.get(app_label="yaksh", model=model)
+ model_class = ctype.model_class()
+
+
###############################################################################
class Course(models.Model):