You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
534 B
Python

from django import forms
from .models import *
from .data import TYPES_CHOICES, ALLERGENS_CHOICES
from datetime import date
class MenuForm(forms.ModelForm):
class Meta:
model = Menu
fields = ['art', 'name', 'price', 'allergens', 'types', 'day']
widgets = {
'types': forms.CheckboxSelectMultiple(choices=TYPES_CHOICES),
'allergens': forms.CheckboxSelectMultiple(choices=ALLERGENS_CHOICES),
'day': forms.DateInput(attrs={'type': 'date'}, format="%d.%m.%Y"),
}