summaryrefslogtreecommitdiffstats
path: root/core/forms.py
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2012-06-10 14:59:21 +0100
committerMartin Green <martin.speleo@gmail.com>2012-06-10 14:59:21 +0100
commit711fefb0da7b4a744c71f3d1648d3398c401f4fc (patch)
treed3fbeeb25593d70bb276f0173807490f7ba91d1d /core/forms.py
parentfd12e70f7818f42f7f569576369dec287fec7ccc (diff)
downloadtroggle-711fefb0da7b4a744c71f3d1648d3398c401f4fc.tar.gz
troggle-711fefb0da7b4a744c71f3d1648d3398c401f4fc.tar.bz2
troggle-711fefb0da7b4a744c71f3d1648d3398c401f4fc.zip
Start to change dataformat for caves, along with there editing. Start to change survex reader to cope better with equates/tags.
Diffstat (limited to 'core/forms.py')
-rw-r--r--core/forms.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/core/forms.py b/core/forms.py
index c38a699..939f64f 100644
--- a/core/forms.py
+++ b/core/forms.py
@@ -1,8 +1,7 @@
from django.forms import ModelForm
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.forms.models import modelformset_factory
from django.contrib.admin.widgets import AdminDateWidget
import string
from datetime import date
@@ -20,16 +19,23 @@ class CaveForm(ModelForm):
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()
+class VersionControlCommentForm(forms.Form):
+ description_of_change = forms.CharField(required = True, widget=forms.Textarea())
-CaveAndEntranceFormSet = formset_factory(CaveAndEntranceForm)
+class EntranceForm(ModelForm):
+ #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 = Entrance
+
+CaveAndEntranceFormSet = modelformset_factory(CaveAndEntrance, exclude=('cave'))
class EntranceForm(ModelForm):
class Meta: