From 28047277f1fb0679c3b94bb5a14d2384a94cc27f Mon Sep 17 00:00:00 2001 From: expo Date: Sun, 12 Aug 2012 19:10:23 +0200 Subject: Started removing foreignkeys to caves, to achieve greater flexability. Some log book entries stuff may be broken. Add ability to make new caves and entrances via website. --- core/forms.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'core/forms.py') diff --git a/core/forms.py b/core/forms.py index e0654fb..da16d79 100644 --- a/core/forms.py +++ b/core/forms.py @@ -16,8 +16,11 @@ class CaveForm(ModelForm): underground_centre_line = forms.CharField(required = False, widget=forms.Textarea()) notes = forms.CharField(required = False, widget=forms.Textarea()) references = forms.CharField(required = False, widget=forms.Textarea()) + slug = forms.CharField(required = True) + url = forms.CharField(required = True) class Meta: model = Cave + exclude = ("filename",) class VersionControlCommentForm(forms.Form): description_of_change = forms.CharField(required = True, widget=forms.Textarea()) @@ -32,14 +35,20 @@ class EntranceForm(ModelForm): #underground_centre_line = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) #notes = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) #references = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) + other_station = forms.CharField(required=False) # Trying to change this to a singl;e line entry + tag_station = forms.CharField(required=False) # Trying to change this to a singl;e line entry + exact_station = forms.CharField(required=False) # Trying to change this to a singl;e line entry + northing = forms.CharField(required=False) # Trying to change this to a singl;e line entry + easting = forms.CharField(required=False) # Trying to change this to a singl;e line entry + alt = forms.CharField(required=False) # Trying to change this to a singl;e line entry + slug = forms.CharField() class Meta: model = Entrance + exclude = ("cached_primary_slug", "filename",) -CaveAndEntranceFormSet = modelformset_factory(CaveAndEntrance, exclude=('cave')) -class EntranceForm(ModelForm): - class Meta: - model = Entrance + +CaveAndEntranceFormSet = modelformset_factory(CaveAndEntrance, exclude=('cave')) #class PersonForm(ModelForm): # class Meta: -- cgit v1.2.3