summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authoradityacp2020-02-17 13:28:01 +0530
committeradityacp2020-02-17 13:28:01 +0530
commit8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a (patch)
tree07e8df762c518881b44556578fe3b5349b31a73c /yaksh/forms.py
parent5eae1a6c6ebba23179052f87b50c2cb34dd62d05 (diff)
parent3995f0a05fe3e681a21116c158708598db0ada08 (diff)
downloadonline_test-8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a.tar.gz
online_test-8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a.tar.bz2
online_test-8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a.zip
Fix conflicts
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py33
1 files changed, 32 insertions, 1 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 4229598..73d4b54 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -300,6 +300,33 @@ class QuestionForm(forms.ModelForm):
"""Creates a form to add or edit a Question.
It has the related fields and functions required."""
+ def __init__(self, *args, **kwargs):
+ super(QuestionForm, self).__init__(*args, **kwargs)
+ self.fields['summary'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Summary'}
+ )
+ self.fields['language'].widget.attrs.update(
+ {'class': 'custom-select'}
+ )
+ self.fields['type'].widget.attrs.update(
+ {'class': 'custom-select'}
+ )
+ self.fields['description'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Description'}
+ )
+ self.fields['tags'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Tags'}
+ )
+ self.fields['solution'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Solution'}
+ )
+ self.fields['snippet'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Snippet'}
+ )
+ self.fields['min_time'].widget.attrs.update(
+ {'class': form_input_class}
+ )
+
class Meta:
model = Question
exclude = ['user', 'active']
@@ -307,7 +334,11 @@ class QuestionForm(forms.ModelForm):
class FileForm(forms.Form):
file_field = forms.FileField(widget=forms.ClearableFileInput(
- attrs={'multiple': True}),
+ attrs={
+ 'multiple': True,
+ 'class': 'custom-file-input'
+ }
+ ),
required=False)