summaryrefslogtreecommitdiff
path: root/ishtar_common/forms_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r--ishtar_common/forms_common.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py
index 31eb5c7d2..2b3227f0a 100644
--- a/ishtar_common/forms_common.py
+++ b/ishtar_common/forms_common.py
@@ -575,20 +575,37 @@ class QAPersonFormMulti(QAForm):
base_models = ['qa_title']
associated_models = {
'qa_title': models.TitleType,
+ 'qa_attached_to': models.Organization,
}
MULTI = True
REPLACE_FIELDS = [
'qa_title',
+ 'qa_attached_to'
]
qa_title = forms.ChoiceField(
label=_(u"Title"), required=False
)
+ qa_attached_to = forms.IntegerField(
+ label=_("Organization"),
+ widget=widgets.JQueryAutoComplete(
+ reverse_lazy('autocomplete-organization'),
+ associated_model=models.Organization),
+ validators=[models.valid_id(models.Organization)],
+ required=False
+ )
TYPES = [
FieldType('qa_title', models.TitleType),
]
+ def _get_qa_attached_to(self, value):
+ try:
+ value = models.Organization.objects.get(pk=value).cached_label
+ except models.Organization.DoesNotExist:
+ return ""
+ return value
+
class PersonMergeFormSelection(ManualMerge, forms.Form):
SEARCH_AND_SELECT = True