diff options
Diffstat (limited to 'tbc/forms.py')
-rw-r--r-- | tbc/forms.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tbc/forms.py b/tbc/forms.py index 685b04f..b55bc5d 100644 --- a/tbc/forms.py +++ b/tbc/forms.py @@ -7,10 +7,23 @@ from tbc.models import * class UserProfileForm(forms.ModelForm): + def __init__(self, *args, **kwargs): + super(UserProfileForm, self).__init__(*args, **kwargs) + self.fields['about'].label = "About Yourself" + self.fields['insti_org'].label = "Institute/Organizaiton" + self.fields['dept_desg'].label = "Department/Branch/Designation" + self.fields['phone_no'].label = "Mobile No" + self.fields['about_proj'].label = "How did you come to know about the project" class Meta: model = Profile exclude = ('user') - + widgets = { + 'about':forms.TextInput(attrs={'placeholder':'Tell us about yourself'}), + 'insti_org':forms.TextInput(attrs={'placeholder':'Name of University/Organizaiton(if corporate)'}), + 'dept_desg':forms.TextInput(attrs={'placeholder':'Name of the Department/Branch or your designation'}), + 'phone_no':forms.TextInput(attrs={'placeholder':'Phone Number Please'}), + } + class UserRegisterForm(UserCreationForm): class Meta: @@ -29,6 +42,22 @@ class UserLoginForm(forms.Form): class BookForm(forms.ModelForm): + def __init__(self, *args, **kwargs): + super(BookForm, self).__init__(*args, **kwargs) + self.fields['publisher_place'].label = "Publisher with Place" + self.fields['isbn'].label = "ISBN No." + self.fields['edition'].label = "Book Edition" + self.fields['year_of_pub'].label = "Year of Publication" + self.fields['no_chapters'].label = "Number of Chapter" class Meta: model = Book exclude = ('contributor') + widgets = { + 'title':forms.TextInput(attrs={'placeholder':'Title of the Book'}), + 'author':forms.TextInput(attrs={'placeholder':'Author of the Book'}), + 'publisher_place':forms.TextInput(attrs={'placeholder':'Name of the Publisher with Place'}), + 'isbn':forms.TextInput(attrs={'placeholder':'Valid ISBN no. of the Book'}), + 'edition':forms.TextInput(attrs={'placeholder':'Edition of the Book'}), + 'year_of_pub':forms.TextInput(attrs={'placeholder':'Year when the Book was published'}), + 'no_chapters':forms.TextInput(attrs={'placeholder':'Total number of chapters in the Book'}), + } |