Created
July 5, 2018 11:49
-
-
Save namantw/2702e1cef4b77008de0b4d2953a8df8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.contrib.auth.models import User | |
from django.contrib.auth.forms import UserCreationForm | |
from .models import Student | |
from django import forms | |
class UserForm(UserCreationForm): | |
class Meta: | |
model = User | |
fields = ['username', 'password1', 'password2'] | |
help_texts = { | |
'username': 'same as your roll no.', | |
} | |
class LoginForm(forms.Form): | |
username = forms.CharField() | |
password = forms.CharField(widget=forms.PasswordInput) | |
class RegistrationForm(forms.ModelForm): | |
class Meta: | |
model = Student | |
fields = [ | |
'student_name', | |
'father_name', | |
'enrollment_no', | |
'course', | |
'dob', | |
'gender'] | |
class SelectionForm(forms.ModelForm): | |
class Meta: | |
model = Student | |
fields = ['room'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment