From fd12e70f7818f42f7f569576369dec287fec7ccc Mon Sep 17 00:00:00 2001 From: Martin Green Date: Wed, 23 May 2012 09:23:40 +0100 Subject: Editing for entrances along with caves More detailed display of entrances --- core/forms.py | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'core/forms.py') diff --git a/core/forms.py b/core/forms.py index b16aa15..c38a699 100644 --- a/core/forms.py +++ b/core/forms.py @@ -9,34 +9,32 @@ from datetime import date from tinymce.widgets import TinyMCE class CaveForm(ModelForm): - underground_description = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) - explorers = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - equipment = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - survey = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - kataster_status = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - underground_centre_line = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - notes = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - references = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) + underground_description = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) + explorers = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) + equipment = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) + survey = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) + kataster_status = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) + 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})) class Meta: model = Cave +class CaveAndEntranceForm(forms.Form): + entrance = forms.ChoiceField(choices=[("", "-----")] + + [(x.slug, x.slug) + for x + in Entrance.objects.all()]) + entrance_letter = forms.CharField(max_length=20) + non_public = forms.BooleanField() + +CaveAndEntranceFormSet = formset_factory(CaveAndEntranceForm) + class EntranceForm(ModelForm): class Meta: model = Entrance -class CaveForm(ModelForm): - underground_description = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) - explorers = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - equipment = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - survey = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - kataster_status = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - underground_centre_line = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - notes = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - references = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) - class Meta: - model = Cave - #class PersonForm(ModelForm): # class Meta: # model = Person -- cgit v1.2.3