diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-28 19:21:41 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-28 19:21:41 +0200 |
commit | 328de388cf7c8cd213752c01dfadc2a19e8acb6f (patch) | |
tree | bd817bec361eff377bdd7b03b3ac2b37631f8c9d /archaeological_files_pdl | |
parent | 6b2730288641ff0206fca8b2c0cbff1b1e442b1f (diff) | |
download | Ishtar-328de388cf7c8cd213752c01dfadc2a19e8acb6f.tar.bz2 Ishtar-328de388cf7c8cd213752c01dfadc2a19e8acb6f.zip |
Too many lazy evaluations and nobody do the job! Fixed.
Diffstat (limited to 'archaeological_files_pdl')
-rw-r--r-- | archaeological_files_pdl/forms.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/archaeological_files_pdl/forms.py b/archaeological_files_pdl/forms.py index 5c92f689a..cf241aa18 100644 --- a/archaeological_files_pdl/forms.py +++ b/archaeological_files_pdl/forms.py @@ -26,7 +26,7 @@ from django.utils.translation import ugettext_lazy as _ from ishtar_common.models import Person, Town, Department, valid_id, \ person_type_pk_lazy, person_type_pks_lazy, organization_type_pks_lazy, \ - organization_type_pk_lazy, organization_type_lazy, person_type_lazy + organization_type_pk_lazy from archaeological_files import models from ishtar_common.forms import get_now, reverse_lazy, ManageOldType @@ -132,10 +132,10 @@ class FileFormResearchAddress(forms.Form): class PersonOrgaForm(forms.Form): PERSON_FIELD = 'TO BE DEFINED' - PERSON_TYPE = person_type_lazy('general_contractor') + PERSON_TYPE_PK = person_type_pk_lazy('general_contractor') PERSON_LABEL = "" ORGA_FIELD = 'TO BE DEFINED' - ORGA_TYPE = organization_type_lazy('general_contractor') + ORGA_TYPE_PK = organization_type_pk_lazy('general_contractor') ORGA_LABEL = "" def _media(self): @@ -202,10 +202,10 @@ class PersonOrgaForm(forms.Form): initial=initial.get(self.PERSON_FIELD, None), widget=widgets.JQueryPersonOrganization( reverse_lazy('autocomplete-person', - args=[self.PERSON_TYPE.pk]), + args=[self.PERSON_TYPE_PK]), reverse_lazy('person_create'), model=Person, - limit={'person_types': [self.PERSON_TYPE.pk], + limit={'person_types': [self.PERSON_TYPE_PK], 'attached_to__isnull': True}, js_template='ishtar/blocks/JQueryNaturalPerson.js', new=True), @@ -217,10 +217,10 @@ class PersonOrgaForm(forms.Form): initial=initial.get(self.ORGA_FIELD, None), widget=widgets.JQueryPersonOrganization( reverse_lazy('autocomplete-organization', - args=[self.ORGA_TYPE.pk]), + args=[self.ORGA_TYPE_PK]), reverse_lazy('organization_create'), model=models.Organization, - limit={'organization_type': [self.ORGA_TYPE.pk]}, + limit={'organization_type': [self.ORGA_TYPE_PK]}, js_template='ishtar/blocks/JQueryCorporationPerson.js', new=True), validators=[valid_id(models.Organization)]) @@ -267,10 +267,10 @@ class FileFormGeneralContractor(PersonOrgaForm): ) PERSON_FIELD = 'general_contractor' - PERSON_TYPE = person_type_lazy('general_contractor') + PERSON_TYPE_PK = person_type_pk_lazy('general_contractor') PERSON_LABEL = _(u"General contractor") ORGA_FIELD = 'corporation_general_contractor' - ORGA_TYPE = organization_type_lazy('general_contractor') + ORGA_TYPE_PK = organization_type_pk_lazy('general_contractor') ORGA_LABEL = _(u"General contractor") def __init__(self, *args, **kwargs): @@ -331,10 +331,10 @@ class FileFormGeneralContractor(PersonOrgaForm): initial=initial.get(self.PERSON_FIELD, None), widget=widgets.JQueryPersonOrganization( reverse_lazy('autocomplete-person', - args=[self.PERSON_TYPE.pk]), + args=[self.PERSON_TYPE_PK]), reverse_lazy('person_create'), model=Person, - limit={'person_types': [self.PERSON_TYPE.pk], + limit={'person_types': [self.PERSON_TYPE_PK], 'attached_to__isnull': True}, js_template='ishtar/blocks/JQueryNaturalPerson.js', new=True), |