first commit
This commit is contained in:
42
Movement/Forms/FormsCalendar.py
Normal file
42
Movement/Forms/FormsCalendar.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from django import forms
|
||||
from Movement import models
|
||||
from django.utils import timezone
|
||||
|
||||
class FormsCalendar(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.Calendar
|
||||
fields = [
|
||||
'client',
|
||||
'date',
|
||||
'time',
|
||||
'service',
|
||||
'pay_method',
|
||||
'professional',
|
||||
'first_time',
|
||||
# 'gross_value',
|
||||
# 'net_value',
|
||||
# 'value_cash',
|
||||
# 'prof_money',
|
||||
]
|
||||
widgets = {
|
||||
'client': forms.Select({'class': 'form-select'}),
|
||||
'time': forms.DateInput(format=('%Y-%m-%d'), attrs={'type': 'time', 'class': '',
|
||||
'value': timezone.localtime(timezone.now()).time()
|
||||
}),
|
||||
'date': forms.DateInput(format=('%Y-%m-%d'), attrs={'type': 'date', 'class':'',
|
||||
'value':timezone.localtime(timezone.now()).date()
|
||||
}),
|
||||
'service': forms.Select({'class': 'form-select'}),
|
||||
'pay_method': forms.Select({'class': 'form-select'}),
|
||||
'professional': forms.Select({'class': 'form-select'}),
|
||||
'first_time': forms.CheckboxInput({'class': ''}),
|
||||
}
|
||||
labels={
|
||||
'client':'Cliente',
|
||||
'date':'Data',
|
||||
'time':'Hora',
|
||||
'service':'Serviço',
|
||||
'pay_method':'Pagamento',
|
||||
'professional':'Profissional',
|
||||
'first_time':'Primeira Vez',
|
||||
}
|
||||
Reference in New Issue
Block a user