Add a custom inlined form renderer that doesn't display title
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 12 Oct 2016 12:29:55 +0200
changeset 1740 d53885d29c38
parent 1739 e0d4e2917137
child 1741 13b39d6ff207
Add a custom inlined form renderer that doesn't display title
views/widgets.py
--- a/views/widgets.py	Thu Oct 13 12:56:28 2016 +0200
+++ b/views/widgets.py	Wed Oct 12 12:29:55 2016 +0200
@@ -250,9 +250,20 @@
 
 class NoTitleEntityInlinedFormRenderer(formrenderers.EntityInlinedFormRenderer):
     """Custom inlined form renderer that doesn't display any title nor remove link.
+
+    This is intended to be subclassed with a custom selector.
     """
 
     __abstract__ = True
 
     def render_title(self, w, form, values):
         pass
+
+
+class ConcretNoTitleEntityInlinedFormRenderer(NoTitleEntityInlinedFormRenderer):
+    """Concret implementation of `NoTitleEntityInlinedFormRenderer` with a custom regid.
+
+    Use this one by specifying the renderer id explicitly, for case where you can't easily specify a
+    selector.
+    """
+    __regid__ = 'notitle'