15 lines
391 B
Python
15 lines
391 B
Python
|
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
|