You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.4 KiB
63 lines
1.4 KiB
from django import forms
|
|
from django.forms import DateInput
|
|
|
|
from .models import *
|
|
|
|
from django import forms
|
|
|
|
''''
|
|
class AddressForm(forms.Form):
|
|
vorname = forms.CharField(max_length=255)
|
|
nachname = forms.CharField(max_length=255)
|
|
geburtstag = forms.DateField(widget=forms.SelectDateWidget)
|
|
street = forms.CharField(max_length=255)
|
|
hausnummer = forms.CharField(max_length=10)
|
|
postleitzahl = forms.CharField(max_length=5)
|
|
|
|
'''
|
|
|
|
|
|
class AddressForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Address
|
|
fields = '__all__'
|
|
# noinspection PyRedundantParentheses
|
|
widgets = {
|
|
'geburtstag': forms.DateInput(
|
|
format=('%Y-%m-%d'),
|
|
attrs={'class': 'form-control',
|
|
'placeholder': 'Wähle ein Datum',
|
|
'type': 'date'
|
|
}
|
|
)
|
|
}
|
|
|
|
def is_valid(self):
|
|
return True
|
|
|
|
|
|
class SummaryForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Summary
|
|
fields = '__all__'
|
|
widgets = {
|
|
'text': forms.Textarea(attrs={'rows': 10, 'cols': 30})
|
|
}
|
|
|
|
|
|
class SalesAreaTypeForm(forms.ModelForm):
|
|
class Meta:
|
|
model = SalesAreaType
|
|
fields = '__all__'
|
|
|
|
|
|
class SalesAreaForm(forms.ModelForm):
|
|
class Meta:
|
|
model = SalesArea
|
|
fields = '__all__'
|
|
|
|
|
|
class CompanyDataForm(forms.ModelForm):
|
|
class Meta:
|
|
model = CompanyData
|
|
fields = '__all__'
|
|
|