diff options
Diffstat (limited to 'core/forms.py')
-rw-r--r-- | core/forms.py | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/core/forms.py b/core/forms.py index 7063f23..b16aa15 100644 --- a/core/forms.py +++ b/core/forms.py @@ -1,15 +1,41 @@ from django.forms import ModelForm -from models import Cave, Person, PersonExpedition, LogbookEntry, QM, Expedition +from models import Cave, Person, PersonExpedition, LogbookEntry, QM, Expedition, Entrance, CaveAndEntrance import django.forms as forms from django.forms.formsets import formset_factory +from django.forms.models import formset_factory from django.contrib.admin.widgets import AdminDateWidget import string from datetime import date from tinymce.widgets import TinyMCE -#class CaveForm(ModelForm): -# class Meta: -# model = Cave +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 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: @@ -48,8 +74,8 @@ from tinymce.widgets import TinyMCE # super(LogbookEntryForm, self).__init__(*args, **kwargs) # self.fields['text'].help_text=self.wikiLinkHints()# -class CaveForm(forms.Form): - html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) +#class CaveForm(forms.Form): +# html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) def getTripForm(expedition): |