From fd0a0165c3a06ecea377cc9a16ac2706b1dc9d40 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 3 Dec 2015 13:05:06 +0100 Subject: Better management of raw_names for search and windows --- ishtar_common/forms_common.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 0e6a34b74..1ff9532e9 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -258,6 +258,7 @@ class SimplePersonForm(NewItemForm): validators=[name_validator]) name = forms.CharField(label=_(u"Name"), max_length=30, validators=[name_validator]) + raw_name = forms.CharField(label=_(u"Raw name"), max_length=255) address = forms.CharField(label=_(u"Address"), widget=forms.Textarea, required=False) address_complement = forms.CharField(label=_(u"Address complement"), @@ -278,6 +279,10 @@ class SimplePersonForm(NewItemForm): associated_model=models.Organization, new=True), validators=[models.valid_id(models.Organization)], required=False) + def __init__(self, *args, **kwargs): + super(SimplePersonForm, self).__init__(*args, **kwargs) + self.fields['raw_name'].widget.attrs['readonly'] = True + class BasePersonForm(forms.ModelForm): class Meta: -- cgit v1.2.3