workout/gym/forms.py

22 lines
498 B
Python
Raw Normal View History

2019-06-23 15:54:59 +02:00
from django.forms import ModelForm
from gym.models import Round
class RoundForm(ModelForm):
class Meta:
model = Round
fields = [
"equipment",
"session",
"theoretical_max_percentage",
"chosen_weight",
"repetition_number",
"work_form",
"notes",
]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["notes"].widget.attrs["rows"] = 3