ext/rest.py
changeset 10957 2fdf67ef3341
parent 10212 dccce2be3101
parent 10953 8b8193046600
child 10960 9e64fddebc89
--- a/ext/rest.py	Fri Nov 13 14:29:48 2015 +0100
+++ b/ext/rest.py	Wed Dec 09 18:24:09 2015 +0100
@@ -34,6 +34,7 @@
 """
 __docformat__ = "restructuredtext en"
 
+import sys
 from itertools import chain
 from logging import getLogger
 from os.path import join
@@ -49,7 +50,7 @@
 from cubicweb import UnknownEid
 from cubicweb.ext.html4zope import Writer
 
-from cubicweb.web.views import vid_from_rset # XXX better not to import c.w.views here...
+from cubicweb.web.views import vid_from_rset  # XXX better not to import c.w.views here...
 
 # We provide our own parser as an attempt to get rid of
 # state machine reinstanciation
@@ -68,6 +69,7 @@
 
 LOGGER = getLogger('cubicweb.rest')
 
+
 def eid_reference_role(role, rawtext, text, lineno, inliner,
                        options={}, content=[]):
     try:
@@ -97,6 +99,7 @@
     return [nodes.reference(rawtext, utils.unescape(rest), refuri=ref,
                             **options)], []
 
+
 def rql_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
     """``:rql:`<rql-expr>``` or ``:rql:`<rql-expr>:<vid>```
 
@@ -130,6 +133,7 @@
     set_classes(options)
     return [nodes.raw('', content, format='html')], []
 
+
 def bookmark_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
     """``:bookmark:`<bookmark-eid>``` or ``:bookmark:`<eid>:<vid>```
 
@@ -187,6 +191,7 @@
     set_classes(options)
     return [nodes.raw('', content, format='html')], []
 
+
 def winclude_directive(name, arguments, options, content, lineno,
                        content_offset, block_text, state, state_machine):
     """Include a reST file as part of the content of this reST file.
@@ -252,6 +257,7 @@
 winclude_directive.options = {'literal': directives.flag,
                               'encoding': directives.encoding}
 
+
 class RQLTableDirective(Directive):
     """rql-table directive
 
@@ -414,6 +420,8 @@
                 # (though try/except may be a better option...). May be the
                 # above traceback option will avoid this?
                 'halt_level': 10,
+                # disable stupid switch to colspan=2 if field name is above a size limit
+                'field_name_limit': sys.maxsize,
                 }
     if context:
         if hasattr(req, 'url'):