-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
42 lines (33 loc) · 1.32 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
from django import forms
from django.forms import ModelForm
from .models import Inventory
from applications.visitor_hostel.models import *
import datetime
#class booking_request(forms.Form):
CHOICES = (('A', 'A',), ('B', 'B',), ('C', 'C',), ('D', 'D',))
class ViewBooking(forms.Form):
date_from = forms.DateField(initial=datetime.date.today)
date_to = forms.DateField(initial=datetime.date.today)
class MealBooking(ModelForm):
date = forms.DateField(initial=datetime.date.today)
class Meta:
model = MealRecord
exclude = ['meal_date']
class RoomAvailability(forms.Form):
date_from = forms.DateField(initial=datetime.date.today)
date_to = forms.DateField(initial=datetime.date.today)
class InventoryForm(forms.ModelForm):
class Meta:
model = Inventory
fields = ["item_name", "quantity", "consumable"]
class Room_booking(forms.Form):
name = forms.CharField(max_length=100)
mob = forms.CharField(max_length=12)
email = forms.CharField(max_length=40)
address = forms.CharField(max_length=200)
country = forms.CharField(max_length=25)
category = forms.ChoiceField(widget=forms.RadioSelect, choices=CHOICES)
total_persons = forms.IntegerField()
purpose = forms.CharField(widget=forms.Textarea)
date_from = forms.DateField(initial=datetime.date.today)
date_to = forms.DateField(initial=datetime.date.today)