summaryrefslogtreecommitdiff
path: root/archaeological_files_pdl/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-08-18 15:07:58 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-08-18 15:07:58 +0200
commit601bcd199a5078ad951f3bce77edc0f1f940a790 (patch)
treecd116e3bfaab2167f5f63ddc350eb55b678acf23 /archaeological_files_pdl/forms.py
parentb158c7375e7cf025b9a3f11cc6978b8a6c6f45b6 (diff)
downloadIshtar-601bcd199a5078ad951f3bce77edc0f1f940a790.tar.bz2
Ishtar-601bcd199a5078ad951f3bce77edc0f1f940a790.zip
Archaeological files: associate many towns. PEP8 and formating.
Diffstat (limited to 'archaeological_files_pdl/forms.py')
-rw-r--r--archaeological_files_pdl/forms.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/archaeological_files_pdl/forms.py b/archaeological_files_pdl/forms.py
index 03c308ba5..393f53b8c 100644
--- a/archaeological_files_pdl/forms.py
+++ b/archaeological_files_pdl/forms.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2014-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -24,11 +24,10 @@ from django.core import validators
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
-from ishtar_common.models import Person, PersonType, valid_id
+from ishtar_common.models import Person, PersonType, Town, valid_id
from archaeological_files import models
from ishtar_common.forms import get_now, reverse_lazy
-from ishtar_common.forms_common import get_advanced_town_field
from archaeological_files.forms import GENERAL_CONTRACTOR, \
GENERAL_CONTRACTOR_ORGA, RESPONSIBLE_PLANNING_SERVICE, \
RESPONSIBLE_PLANNING_SERVICE_ORGA
@@ -75,10 +74,12 @@ class FileFormPreventiveType(forms.Form):
class FileFormPlanning(forms.Form):
form_label = _(u"Planning")
- associated_models = {'main_town': models.Town}
+ base_model = 'town'
+ associated_models = {'town': Town}
name = forms.CharField(label=_(u"Planning name"), required=False,
max_length=100)
- main_town = get_advanced_town_field(required=True)
+ town = widgets.MultipleAutocompleteField(
+ model=Town, label=_("Towns"), required=False)
locality = forms.CharField(label=_(u"Locality"), max_length=100,
required=False)
address = forms.CharField(
@@ -103,8 +104,10 @@ class FileFormPlanning(forms.Form):
class FileFormResearchAddress(forms.Form):
form_label = _(u"Address")
- associated_models = {'main_town': models.Town}
- main_town = get_advanced_town_field(required=True)
+ base_model = 'town'
+ associated_models = {'town': Town}
+ town = widgets.MultipleAutocompleteField(
+ model=Town, label=_("Towns"), required=False)
locality = forms.CharField(label=_(u"Locality"), max_length=100,
required=False)
address = forms.CharField(