diff options
author | Martin Green <martin.speleo@gmail.com> | 2012-01-07 19:05:25 +0000 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2012-01-07 19:05:25 +0000 |
commit | fac89bae3076664b263d2f09de6783bf31fea33f (patch) | |
tree | 3748f600a5cf98204a22c81d184e2abcd1c78618 /core/forms.py | |
parent | ab97e367cb1ca40ab6c8e84c2999801fa64a14b5 (diff) | |
download | troggle-fac89bae3076664b263d2f09de6783bf31fea33f.tar.gz troggle-fac89bae3076664b263d2f09de6783bf31fea33f.tar.bz2 troggle-fac89bae3076664b263d2f09de6783bf31fea33f.zip |
Render a cave editing page. Nb it does not do save anything yet.
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): |