diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-15 00:07:16 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-15 00:07:16 +0200 |
commit | 877ca018dea3ae180c305edc2171c5ec71af4902 (patch) | |
tree | 880eff06a16fa8537231bab8e79ca9114c68419f /ishtar_common/forms_common.py | |
parent | 5c2457815a333edb98ccfb91c7bbf59db1501ccd (diff) | |
download | Ishtar-877ca018dea3ae180c305edc2171c5ec71af4902.tar.bz2 Ishtar-877ca018dea3ae180c305edc2171c5ec71af4902.zip |
Add QA for orgas and operations
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 5eaa6c435..67e29289a 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -376,7 +376,7 @@ class OrganizationSelect(CustomForm, TableSelect): models.OrganizationType.get_types() -class OrganizationFormSelection(forms.Form): +class OrganizationFormSelection(CustomFormSearch): SEARCH_AND_SELECT = True form_label = _(u"Organization search") associated_models = {'pk': models.Organization} @@ -404,6 +404,27 @@ class OrganizationFormMultiSelection(MultiSearchForm): validators=[models.valid_ids(models.Organization)]) +class QAOrganizationFormMulti(QAForm): + form_admin_name = _(u"Organization - Quick action - Modify") + form_slug = "organization-quickaction-modify" + base_models = ['qa_organization_type'] + associated_models = { + 'qa_organization_type': models.OrganizationType, + } + + MULTI = True + REPLACE_FIELDS = [ + 'qa_organization_type', + ] + qa_organization_type = forms.ChoiceField( + label=_(u"Organization type"), required=False + ) + + TYPES = [ + FieldType('qa_organization_type', models.OrganizationType), + ] + + class ManualMerge(object): def clean_to_merge(self): value = self.cleaned_data.get('to_merge', None) or [] @@ -1421,14 +1442,13 @@ class QADocumentFormMulti(QAForm): ) qa_authors = widgets.ModelJQueryAutocompleteField( model=models.Author, label=_(u"Author"), new=True, - long_widget=True, required=False) + 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: |