Edit contents.json online

This commit is contained in:
Philip Sargent
2022-03-17 00:41:29 +00:00
parent e34f162688
commit 19d017a457
5 changed files with 246 additions and 56 deletions

View File

@@ -53,12 +53,6 @@ class CaveForm(ModelForm):
self._errors["url"] = self.error_class(["This field cannot start with a /."])
return self.cleaned_data
# class VersionControlCommentForm(forms.Form):
# '''Was appended to all forms. Not used currently
# '''
# description_of_change = forms.CharField(required = True, widget=forms.Textarea(attrs={'rows':2}))
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 presentaiton style
@@ -95,9 +89,10 @@ class EntranceForm(ModelForm):
# This next line is called from the templates/edit_cave2.html template.
# This is sufficeint to create an entire entry for for the cave fields automatically
# This is sufficient to create an entire entry for for the cave fields automatically
# http://localhost:8000/cave/new/
# using django built-in Deep magic. https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/
# using django built-in Deep Magic. https://docs.djangoproject.com/en/3.2/topics/forms/modelforms/
# for forms which map directly onto a Django Model
CaveAndEntranceFormSet = modelformset_factory(CaveAndEntrance, exclude=('cave',))
class EntranceLetterForm(ModelForm):