diff options
author | Martin Green <martin.speleo@gmail.com> | 2012-05-23 09:23:40 +0100 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2012-05-23 09:23:40 +0100 |
commit | 52620ea1c58d80387eb2e19b45228ada393f4701 (patch) | |
tree | 76fcaaada4ef37f09ba78845e11b8d638c9d7788 /core/forms.py | |
parent | 599c59454a12a0cc4f9c7b0d88a5c1d8e054d2f2 (diff) | |
download | troggle-52620ea1c58d80387eb2e19b45228ada393f4701.tar.gz troggle-52620ea1c58d80387eb2e19b45228ada393f4701.tar.bz2 troggle-52620ea1c58d80387eb2e19b45228ada393f4701.zip |
Editing for entrances along with caves
More detailed display of entrances
Diffstat (limited to 'core/forms.py')
-rw-r--r-- | core/forms.py | 38 |
1 files changed, 18 insertions, 20 deletions
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 |