diff options
author | ankitjavalkar | 2016-04-27 18:44:18 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-05-05 19:19:00 +0530 |
commit | 23216995e0fc0e94fd58c6186eed74c943ae5081 (patch) | |
tree | 40820b09a5520fc00801f3ab42d57a73ba7b7a06 /yaksh/forms.py | |
parent | c557e19470a389aaac569516ed56e1c5b453fd88 (diff) | |
download | online_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/forms.py')
-rw-r--r-- | yaksh/forms.py | 7 |
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: |