Add profile info

This commit is contained in:
cuom1999 2024-04-26 22:51:16 -05:00
parent 55a85689e9
commit 8d0045ec82
10 changed files with 353 additions and 157 deletions

View file

@ -39,6 +39,7 @@ from judge.models import (
BlogPost,
ContestProblem,
TestFormatterModel,
ProfileInfo,
)
from judge.widgets import (
@ -51,6 +52,7 @@ from judge.widgets import (
Select2MultipleWidget,
DateTimePickerWidget,
ImageWidget,
DatePickerWidget,
)
@ -69,6 +71,17 @@ class UserForm(ModelForm):
]
class ProfileInfoForm(ModelForm):
class Meta:
model = ProfileInfo
fields = ["tshirt_size", "date_of_birth", "address"]
widgets = {
"tshirt_size": Select2Widget(attrs={"style": "width:100%"}),
"date_of_birth": DatePickerWidget,
"address": forms.TextInput(attrs={"style": "width:100%"}),
}
class ProfileForm(ModelForm):
class Meta:
model = Profile