summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-04-04 20:49:29 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-04-04 20:49:29 +0200
commitf41b22f173bb9c9c331fa9eab2a7a8d47d0a57db (patch)
tree673bfb7389360f360ddaafcfe1a4d133d67f4c36 /archaeological_operations
parent93de2ae2223f284431000c66ba7d94f6f73eb658 (diff)
downloadIshtar-f41b22f173bb9c9c331fa9eab2a7a8d47d0a57db.tar.bz2
Ishtar-f41b22f173bb9c9c331fa9eab2a7a8d47d0a57db.zip
Inline formset to manage parcels
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/forms.py8
-rw-r--r--archaeological_operations/wizards.py5
2 files changed, 10 insertions, 3 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 0318d4207..741dfb2b7 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -37,8 +37,9 @@ from archaeological_files.models import File
import models
from widgets import ParcelWidget
from ishtar_common import widgets
-from ishtar_common.forms import FinalForm, FormSet, ClosingDateFormSelection, \
- formset_factory, get_now, reverse_lazy, get_form_selection, TableSelect
+from ishtar_common.forms import BaseFormSet, FinalForm, FormSet, \
+ ClosingDateFormSelection, formset_factory, get_now, reverse_lazy, \
+ get_form_selection, TableSelect
from ishtar_common.forms_common import TownForm, TownFormSet, TownFormset, \
AuthorFormset, SourceForm, SourceSelect, \
SourceDeletionForm, get_town_field
@@ -94,6 +95,9 @@ class ParcelForm(forms.Form):
return self.cleaned_data
class ParcelFormSet(FormSet):
+ def add_fields(self, form, index):
+ super(FormSet, self).add_fields(form, index)
+
def clean(self):
"""Checks that no parcels are duplicated."""
return self.check_duplicate(('town', 'section',
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index 3281a5723..2b13e3353 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -34,9 +34,12 @@ class OperationWizard(Wizard):
def get_template_names(self):
templates = super(OperationWizard, self).get_template_names()
- current_step = self.steps. current
+ current_step = self.steps.current
if current_step.startswith('towns-'):
templates = ['ishtar/wizard/towns_wizard.html'] + templates
+ if current_step.startswith('parcels-') or \
+ current_step.startswith('parcelsgeneral-') :
+ templates = ['ishtar/wizard/parcels_wizard.html'] + templates
return templates
def get_context_data(self, form, **kwargs):