mamweb/vyroci/forms.py

15 lines
391 B
Python
Raw Normal View History

2023-06-02 21:04:11 +02:00
from django.forms import ModelForm
from .models import UcastnikVyroci
class UcastnikVyrociForm(ModelForm):
class Meta:
model = UcastnikVyroci
fields = "__all__"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for field in ["kdy", "cojemam", "cislo", "dodat"]:
self.fields[field].widget.attrs['rows'] = 2
self.fields[field].widget.attrs['cols'] = 22