website/src/events/forms.py

20 lines
611 B
Python
Raw Normal View History

from django import forms
2021-12-17 19:02:19 +01:00
from .models import Team
class submit_flag(forms.Form):
flag = forms.CharField(label="Flag", max_length=100)
2021-12-17 19:02:19 +01:00
class create_team(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta():
model = Team
2022-01-02 20:42:10 +01:00
fields = ('name','password')
class TeamUpdateForm(forms.ModelForm):
class Meta:
model = Team
fields=('name', 'password',)
def __init__(self, *args, **kwargs):
super(TeamUpdateForm, self).__init__(*args, **kwargs)
for key in self.fields:
self.fields[key].required = True