2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 03:07:40 +00:00

bugfixes and more comments

This commit is contained in:
2024-12-19 22:55:08 +00:00
parent 19bbb00dcc
commit 011e6777c9
7 changed files with 57 additions and 10 deletions

View File

@@ -45,6 +45,8 @@ todo = """
class CaveForm(ModelForm):
"""Only those fields for which we want to override defaults are listed here
the other fields of the class Cave are present on the form, but use the default presentation style
see https://docs.djangoproject.com/en/5.1/topics/forms/modelforms/
"""
unofficial_number= forms.CharField(required=False,
label="Unofficial Number used to construct internal identifiers",
@@ -143,6 +145,8 @@ class CaveForm(ModelForm):
class EntranceForm(ModelForm):
"""Only those fields for which we want to override defaults are listed here
the other fields are present on the form, but use the default presentation style
see https://docs.djangoproject.com/en/5.1/topics/forms/modelforms/
"""
name = forms.CharField(required=False, widget=forms.TextInput(attrs={"size": "45", "placeholder": "usually leave this blank"}))
@@ -240,7 +244,6 @@ class EntranceForm(ModelForm):
# # This next line is sufficient to create an entire entry for for the cave fields automatically
# # using django built-in Deep Magic. https://docs.djangoproject.com/en/dev/topics/forms/modelforms/
# # for forms which map directly onto a Django Model
# CaveAndEntranceFormSet = modelformset_factory(CaveAndEntrance, exclude=("cave",))
# # This is used only in templates/editcave.html which is called only to edit caves in core/views/cave.py
@@ -250,6 +253,8 @@ class EntranceLetterForm(ModelForm):
Nb. The relationship between caves and entrances has historically been a many to many relationship.
With entrances gaining new caves and letters when caves are joined.
see https://docs.djangoproject.com/en/5.1/topics/forms/modelforms/
"""
# This only needs to be required=True for the second and subsequent entrances, not the first. Tricky.