diff options
author | CruiseDevice | 2020-04-14 20:13:52 +0530 |
---|---|---|
committer | CruiseDevice | 2020-04-14 20:13:52 +0530 |
commit | 508e0e78bb0bd3e8ebbad81e948f13de5c01b20f (patch) | |
tree | 1c320cf927c4f594c11ad86f564dc82f206a2a39 /yaksh/forms.py | |
parent | 2f9331717075b34534f2745706f57a98f7dce20d (diff) | |
download | online_test-508e0e78bb0bd3e8ebbad81e948f13de5c01b20f.tar.gz online_test-508e0e78bb0bd3e8ebbad81e948f13de5c01b20f.tar.bz2 online_test-508e0e78bb0bd3e8ebbad81e948f13de5c01b20f.zip |
Change model name Thread to Post to avoid conflicts
- Thread class from threading conflicts with the forum Thread model.
- Tests for models and views.
- PEP8 fix.
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r-- | yaksh/forms.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index e66c898..819bb49 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -1,7 +1,7 @@ from django import forms from yaksh.models import ( get_model_class, Profile, Quiz, Question, Course, QuestionPaper, Lesson, - LearningModule, TestCase, languages, question_types, Thread, Comment + LearningModule, TestCase, languages, question_types, Post, Comment ) from grades.models import GradingSystem from django.contrib.auth import authenticate @@ -32,7 +32,7 @@ test_case_types = ( ) status_types = ( - ('select','Select Status'), + ('select', 'Select Status'), ('active', 'Active'), ('closed', 'Inactive'), ) @@ -369,7 +369,7 @@ class SearchFilterForm(forms.Form): search_tags = forms.CharField( label='Search Tags', widget=forms.TextInput(attrs={'placeholder': 'Search', - 'class': form_input_class,}), + 'class': form_input_class, }), required=False ) search_status = forms.CharField(max_length=16, widget=forms.Select( @@ -554,23 +554,23 @@ class TestcaseForm(forms.ModelForm): fields = ["type"] -class ThreadForm(forms.ModelForm): +class PostForm(forms.ModelForm): class Meta: - model = Thread + model = Post fields = ["title", "description", "image"] widgets = { 'title': forms.TextInput( - attrs = { + attrs={ 'class': 'form-control' } ), 'description': forms.Textarea( - attrs = { + attrs={ 'class': 'form-control' } ), 'image': forms.FileInput( - attrs = { + attrs={ 'class': 'form-control-file' } ) @@ -583,12 +583,12 @@ class CommentForm(forms.ModelForm): fields = ["description", "image"] widgets = { 'description': forms.Textarea( - attrs = { + attrs={ 'class': 'form-control' } ), 'image': forms.FileInput( - attrs = { + attrs={ 'class': 'form-control-file' } ) |