[PATCH eac] Use a TextArea widget for all "description" attributes

Denis Laxalde denis.laxalde at logilab.fr
Tue Oct 30 11:45:43 CET 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1540896320 -3600
#      Tue Oct 30 11:45:20 2018 +0100
# Node ID 87f0ecd7692186bffeba7845c85d66c0a002da2c
# Parent  26d6b359607db70050569acd517f6105ed35f773
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r 87f0ecd76921
Use a TextArea widget for all "description" attributes

This is so that users can insert paragraphs (which will be exported in
XML, per 7b8516b0f4e5).

diff --git a/cubicweb_eac/views.py b/cubicweb_eac/views.py
--- a/cubicweb_eac/views.py
+++ b/cubicweb_eac/views.py
@@ -102,6 +102,15 @@ for etype, rtype in (
 ):
     afs.tag_subject_of((etype, rtype, '*'), 'main', 'hidden')
 
+# TextArea for all description attributes where <p> is allowed.
+for etype in (
+    'AgentFunction',
+    'Mandate',
+    'Occupation',
+    'Structure',
+):
+    affk.set_field_kwargs(etype, 'description', widget=fw.TextArea())
+
 # Citation
 pvdc.tag_attribute(('Citation', 'uri'), {'vid': 'urlattr'})
 # Generic rules for all entity types having an `has_citation` relationship.



More information about the saem-devel mailing list