summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 9ffef5e..ddb1819 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -1,5 +1,5 @@
from django import forms
-from yaksh.models import Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdoutBasedTestCase
+from yaksh.models import get_model_class, Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdoutBasedTestCase
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
@@ -44,9 +44,10 @@ attempts.append((-1, 'Infinite'))
days_between_attempts = ((j, j) for j in range(401))
def get_object_form(model, exclude_fields=None):
- ctype = ContentType.objects.get(app_label="yaksh", model=model)
+ # ctype = ContentType.objects.get(app_label="yaksh", model=model)
# ctype = ContentType.objects.get(pk=type_id)
- model_class = ctype.model_class()
+ # model_class = ctype.model_class()
+ model_class = get_model_class(model)
class _ObjectForm(forms.ModelForm):
# def __init__(self, *args, **kwargs):
# if "question" in kwargs: