Skip to content

Commit f0363b9

Browse files
committed
Switch to using ModelForm
1 parent a0d9e2a commit f0363b9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/community_db/forms.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class QuickSearchForm(forms.Form):
77
search = forms.CharField(max_length=100, required=False)
88

99

10-
class PersonForm(forms.Form):
11-
first_name = forms.CharField(max_length=100)
12-
last_name = forms.CharField(max_length=100)
13-
country = forms.ChoiceField(required=False, choices=Person.Countries.choices)
14-
mobile_number = forms.CharField(max_length=20, required=False)
10+
class PersonForm(forms.ModelForm):
11+
class Meta:
12+
model = Person
13+
# fields = ["first_name", "last_name", "country", "mobile_number"]
14+
exclude = []

0 commit comments

Comments
 (0)