diff options
author | pnshiralkar | 2020-05-07 13:58:16 +0530 |
---|---|---|
committer | pnshiralkar | 2020-05-07 13:58:16 +0530 |
commit | 198431be862cea5fe369fc07bca3e435ce2f7d79 (patch) | |
tree | 662cf8c6bb780b4c5de86539eae3649f83af24b7 /workshop_app/forms.py | |
parent | 83be359156350d851950f090dea9906d022e478b (diff) | |
download | workshop_booking-198431be862cea5fe369fc07bca3e435ce2f7d79.tar.gz workshop_booking-198431be862cea5fe369fc07bca3e435ce2f7d79.tar.bz2 workshop_booking-198431be862cea5fe369fc07bca3e435ce2f7d79.zip |
Add workshop types done without attachment files
Diffstat (limited to 'workshop_app/forms.py')
-rw-r--r-- | workshop_app/forms.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/workshop_app/forms.py b/workshop_app/forms.py index 334bd4e..fcb34c4 100644 --- a/workshop_app/forms.py +++ b/workshop_app/forms.py @@ -3,7 +3,7 @@ from string import punctuation, digits from django import forms from django.utils import timezone -from .models import (Profile, Workshop, ProfileComments, department_choices, title, source, states) +from .models import (Profile, Workshop, ProfileComments, department_choices, title, source, states, WorkshopType) try: from string import letters @@ -189,3 +189,16 @@ class ProfileCommentsForm(forms.ModelForm): widgets = { 'comments': forms.CharField(), } + + +class WorkshopTypeForm(forms.ModelForm): + def __init__(self, *args, **kwargs): + super(WorkshopTypeForm, self).__init__(*args, **kwargs) + for field in self.visible_fields(): + field.field.widget.attrs['class'] = 'form-control' + field.field.widget.attrs['placeholder'] = field.label + field.field.widget.attrs['rows'] = 6 + + class Meta: + model = WorkshopType + exclude = [] |