From fac89bae3076664b263d2f09de6783bf31fea33f Mon Sep 17 00:00:00 2001 From: Martin Green Date: Sat, 7 Jan 2012 19:05:25 +0000 Subject: Render a cave editing page. Nb it does not do save anything yet. --- core/forms.py | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'core/forms.py') 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): -- cgit v1.2.3