mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-01-19 18:32:54 +00:00
make fields required
This commit is contained in:
@@ -288,6 +288,11 @@ class EntranceLetterForm(ModelForm):
|
||||
|
||||
|
||||
class NewProspectForm(forms.Form):
|
||||
"""
|
||||
This is sufficient to create an entire HTML form automagically
|
||||
in the Django template using {% for field in form %}.
|
||||
This is where field labels, placeholder text and field validation are defined.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
# If the form is bound (POSTed), update the field's value to uppercase
|
||||
@@ -323,6 +328,7 @@ class NewProspectForm(forms.Form):
|
||||
date_found = forms.DateField(
|
||||
label="Date Found (YYYY-MM-DD)",
|
||||
input_formats=["%Y-%m-%d"],
|
||||
required=True,
|
||||
widget=forms.DateInput(attrs={
|
||||
"type": "text",
|
||||
"placeholder": "2025-08-23",
|
||||
@@ -340,6 +346,7 @@ class NewProspectForm(forms.Form):
|
||||
)
|
||||
identifier = forms.CharField(
|
||||
label="New cave identifier",
|
||||
required=True,
|
||||
max_length=20,
|
||||
widget=forms.TextInput(attrs={
|
||||
"placeholder": "2025-AB-01",
|
||||
@@ -378,28 +385,26 @@ class NewProspectForm(forms.Form):
|
||||
)
|
||||
|
||||
discoverers = forms.CharField(
|
||||
label="Names of discoverers",
|
||||
label="All the discoverers",
|
||||
max_length=100,
|
||||
required=False,
|
||||
required=True,
|
||||
widget=forms.TextInput(attrs={
|
||||
"placeholder": "Becka, Bill, Ted",
|
||||
"placeholder": "Bill, Ted, Becka",
|
||||
"size": 20,
|
||||
"style": "width: 20ch; min-width: 0;"
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
who_are_you = forms.CharField(
|
||||
label="Who are you",
|
||||
max_length=100,
|
||||
required=False,
|
||||
required=True,
|
||||
widget=forms.TextInput(attrs={
|
||||
"size": 100,
|
||||
"placeholder": "You are editing this page, who are you ? e.g. 'Becka' or 'Animal <mta@gasthof.expo>'",
|
||||
"style": "width: 100ch; min-width: 0;"
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
identified_login = forms.BooleanField(
|
||||
label="Identified login",
|
||||
required=False,
|
||||
|
||||
Reference in New Issue
Block a user