diff options
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 |