From 522d422781fa622040f2a77d0bb85187cc386750 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 5 Dec 2013 11:01:34 +0100 Subject: Add address to person form (refs #1527) --- ishtar_common/forms_common.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 661709a09..584759c29 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -132,6 +132,15 @@ class PersonForm(forms.Form): validators=[name_validator]) name = forms.CharField(label=_(u"Name"), max_length=30, validators=[name_validator]) + address = forms.CharField(label=_(u"Address"), widget=forms.Textarea, + required=False) + address_complement = forms.CharField(label=_(u"Address complement"), + widget=forms.Textarea, required=False) + postal_code = forms.CharField(label=_(u"Postal code"), max_length=10, + required=False) + town = forms.CharField(label=_(u"Town"), max_length=30, required=False) + country = forms.CharField(label=_(u"Country"), max_length=30, + required=False) email = forms.CharField(label=_(u"Email"), max_length=40, required=False, validators=[validators.validate_email]) attached_to = forms.IntegerField(label=_("Current organization"), -- cgit v1.2.3 From 4fe7989786ec2a0110b2fb2ad9356d7cc24b18e4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 5 Dec 2013 13:27:29 +0100 Subject: Fix Person modification --- ishtar_common/forms_common.py | 4 +++- ishtar_common/views.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 584759c29..b6cab8b6a 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -124,7 +124,7 @@ class PersonFormSelection(forms.Form): PersonSelect, models.Person), validators=[models.valid_id(models.Person)]) -class PersonForm(forms.Form): +class SimplePersonForm(forms.Form): form_label = _("Identity") associated_models = {'attached_to':models.Organization} title = forms.ChoiceField(label=_("Title"), choices=models.Person.TYPE) @@ -148,6 +148,8 @@ class PersonForm(forms.Form): reverse_lazy('autocomplete-organization'), associated_model=models.Organization, new=True), validators=[models.valid_id(models.Organization)], required=False) + +class PersonForm(SimplePersonForm): person_types = forms.MultipleChoiceField(label=_("Person type"), choices=[], widget=forms.CheckboxSelectMultiple) diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 31f5f688b..c992b1a76 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -52,7 +52,7 @@ from menus import menu from ishtar_common.forms import FinalForm from ishtar_common.forms_common import PersonForm, PersonTypeForm, \ PersonFormSelection, AccountForm, FinalAccountForm, OrganizationForm, \ - AuthorForm + AuthorForm, SimplePersonForm from ishtar_common.wizards import PersonWizard, PersonModifWizard, AccountWizard import models @@ -74,7 +74,7 @@ def index(request): context_instance=RequestContext(request)) person_creation_wizard = PersonWizard.as_view([ - ('identity-person_creation', PersonForm), + ('identity-person_creation', SimplePersonForm), ('person_type-person_creation', PersonTypeForm), ('final-person_creation', FinalForm)], label=_(u"New person"), @@ -82,7 +82,7 @@ person_creation_wizard = PersonWizard.as_view([ person_modification_wizard = PersonModifWizard.as_view([ ('selec-person_modification', PersonFormSelection), - ('identity-person_modification', PersonForm), + ('identity-person_modification', SimplePersonForm), ('person_type-person_creation', PersonTypeForm), ('final-person_modification', FinalForm)], label=_(u"Person modification"), -- cgit v1.2.3