diff options
author | adityacp | 2020-04-27 14:50:28 +0530 |
---|---|---|
committer | adityacp | 2020-04-27 14:50:28 +0530 |
commit | 9fe624415d15f63f45a5327d74fe8c2432b03d13 (patch) | |
tree | 8781ccf6c01c8e124a0c836b487a23499e441bf1 /yaksh/forms.py | |
parent | d5cdfe91335af6c79231d41453991af29a39e96e (diff) | |
parent | 53a0c4ad3e733f3960000527f83565f2fd8fc412 (diff) | |
download | online_test-9fe624415d15f63f45a5327d74fe8c2432b03d13.tar.gz online_test-9fe624415d15f63f45a5327d74fe8c2432b03d13.tar.bz2 online_test-9fe624415d15f63f45a5327d74fe8c2432b03d13.zip |
Resolve conflict
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r-- | yaksh/forms.py | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index 81b067c..216f5c2 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 + 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'), ) @@ -381,7 +381,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.ChoiceField( @@ -571,3 +571,44 @@ class TestcaseForm(forms.ModelForm): class Meta: model = TestCase fields = ["type"] + + +class PostForm(forms.ModelForm): + class Meta: + model = Post + fields = ["title", "description", "image"] + widgets = { + 'title': forms.TextInput( + attrs={ + 'class': 'form-control' + } + ), + 'description': forms.Textarea( + attrs={ + 'class': 'form-control' + } + ), + 'image': forms.FileInput( + attrs={ + 'class': 'form-control-file' + } + ) + } + + +class CommentForm(forms.ModelForm): + class Meta: + model = Comment + fields = ["description", "image"] + widgets = { + 'description': forms.Textarea( + attrs={ + 'class': 'form-control' + } + ), + 'image': forms.FileInput( + attrs={ + 'class': 'form-control-file' + } + ) + } |