diff options
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 16c9dd52d..5eaa6c435 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1409,6 +1409,7 @@ class QADocumentFormMulti(QAForm): base_models = ['qa_source_type'] associated_models = { 'qa_source_type': models.SourceType, + 'qa_authors': models.Author, } MULTI = True @@ -1418,11 +1419,22 @@ class QADocumentFormMulti(QAForm): qa_source_type = forms.ChoiceField( label=_(u"Source type"), required=False ) + qa_authors = widgets.ModelJQueryAutocompleteField( + model=models.Author, label=_(u"Author"), new=True, + long_widget=True, required=False) TYPES = [ FieldType('qa_source_type', models.SourceType), ] + def _get_qa_authors(self, value): + print(value) + try: + value = models.Author.objects.get(pk=value).cached_label + except models.Author.DoesNotExist: + return "" + return value + class QALockForm(forms.Form): action = forms.ChoiceField( |