Skip to content
Permalink
1db41635c6
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
28 lines (22 sloc) 809 Bytes
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()