[views] Use the relation widget on relations targeting an authority record
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 06 Feb 2017 15:31:06 +0100
changeset 2336 bf4ab9934280
parent 2332 311edbe5c745
child 2337 a30e5b281d79
[views] Use the relation widget on relations targeting an authority record On the saemref demo with a few thousands of authority records, it's necessary to have such 'lazy' widget.
views/archiveunit.py
--- a/views/archiveunit.py	Mon Feb 06 15:29:56 2017 +0100
+++ b/views/archiveunit.py	Mon Feb 06 15:31:06 2017 +0100
@@ -911,10 +911,13 @@
 
 pvs.tag_object_of(('*', 'seda_seq_alt_archive_unit_archive_unit_ref_id_management', '*'), 'hidden')
 
-affk.tag_subject_of(('SEDALanguage', 'seda_language_to', '*'),
-                    {'widget': rwdg.RelationFacetWidget})
-affk.tag_subject_of(('SEDADescriptionLanguage', 'seda_description_language_to', '*'),
-                    {'widget': rwdg.RelationFacetWidget})
+for rtype in ('seda_language_to', 'seda_description_language_to',
+              'seda_archival_agency', 'seda_transferring_agency',
+              'seda_originating_agency_to', 'seda_submission_agency_to',
+              'seda_authorized_agent_to',
+              'seda_writer_to', 'seda_addressee_to', 'seda_recipient_to'):
+    affk.tag_subject_of(('*', rtype, '*'),
+                        {'widget': rwdg.RelationFacetWidget})
 
 affk.set_fields_order(CONTENT_ETYPE,
                       ['user_cardinality', 'user_annotation'] + content_ordered_fields)