ext/rest.py
changeset 10960 9e64fddebc89
parent 10708 d5e3fffa9c07
parent 10957 2fdf67ef3341
--- a/ext/rest.py	Tue Sep 08 09:05:31 2015 +0200
+++ b/ext/rest.py	Thu Dec 10 12:34:15 2015 +0100
@@ -34,6 +34,7 @@
 """
 __docformat__ = "restructuredtext en"
 
+import sys
 from itertools import chain
 from logging import getLogger
 from os.path import join
@@ -51,7 +52,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
@@ -70,6 +71,7 @@
 
 LOGGER = getLogger('cubicweb.rest')
 
+
 def eid_reference_role(role, rawtext, text, lineno, inliner,
                        options={}, content=[]):
     try:
@@ -99,6 +101,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>```
 
@@ -132,6 +135,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>```
 
@@ -189,6 +193,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.
@@ -254,6 +259,7 @@
 winclude_directive.options = {'literal': directives.flag,
                               'encoding': directives.encoding}
 
+
 class RQLTableDirective(Directive):
     """rql-table directive
 
@@ -416,6 +422,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'):