-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
31 lines (23 loc) · 841 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Building, BuildingTenant
from bootstrap_datepicker_plus import DatePickerInput
class SignUpForm(UserCreationForm):
phone = forms.IntegerField()
name = forms.CharField(max_length=150)
next_of_kin = forms.CharField(max_length=100)
class Meta:
model = User
fields = ('username', 'password1', 'password2', )
class BuildingForm(forms.ModelForm):
class Meta:
model = Building
exclude = ("owner", "tenant",)
class BuildingTenantForm(forms.ModelForm):
class Meta:
model = BuildingTenant
fields = "__all__"
widgets = {
'checkInDate': DatePickerInput(), # default date-format %m/%d/%Y will be used
}