forked from expo/troggle
Start to change dataformat for caves, along with there editing. Start to change survex reader to cope better with equates/tags.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user