Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
delivry/delivery/forms.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28 lines (22 sloc)
809 Bytes
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 | |
# accounts | |
from django.contrib.auth.forms import UserCreationForm, UserChangeForm | |
from django.contrib.auth.models import User | |
from .models import employee,deliverym | |
class RegisterForm(forms.ModelForm): | |
password = forms.CharField(widget=forms.PasswordInput()) | |
class Meta(): | |
model = User | |
fields = ('username','password','email') | |
class EmpForm(forms.ModelForm): | |
class Meta: | |
model = employee | |
fields = ('phonenumber',) | |
def clean(self): | |
cleaned_data = super(EmpForm, self).clean() | |
class DeliveryForm(forms.ModelForm): | |
class Meta: | |
model = deliverym | |
fields = ('source','destination','route','delivery_id') | |
def clean(self): | |
cleaned_data = super(DeliveryForm, self).clean() |