first commit
This commit is contained in:
33
Movement/Forms/FormsStock.py
Normal file
33
Movement/Forms/FormsStock.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from django import forms
|
||||
from Movement import models
|
||||
from django.utils import timezone
|
||||
|
||||
class FormsStock(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.Stock
|
||||
fields = [
|
||||
'date',
|
||||
'product',
|
||||
'quantity',
|
||||
'gross_value',
|
||||
'bank',
|
||||
'notes',
|
||||
]
|
||||
widgets = {
|
||||
'date': forms.DateInput(format=('%Y-%m-%d'), attrs={'type': 'date', 'class':'',
|
||||
'value':timezone.localtime(timezone.now()).date()
|
||||
}),
|
||||
'product': forms.Select({'class': 'form-select'}),
|
||||
'quantity': forms.NumberInput(attrs={'step': 1}),
|
||||
'gross_value': forms.NumberInput(attrs={'step': 1}),
|
||||
'bank': forms.Select({'class': 'form-select'}),
|
||||
'notes': forms.Textarea({'class': 'form-control', 'rows': 3, }),
|
||||
}
|
||||
labels={
|
||||
'date':'Data',
|
||||
'product':'Produto',
|
||||
'quantity':'Quantidade',
|
||||
'gross_value':'Valor',
|
||||
'bank':'Banco',
|
||||
'notes':'Notas',
|
||||
}
|
||||
Reference in New Issue
Block a user