view.py
changeset 2656 a93ae0f6c0ad
parent 2644 100b81ba3a98
child 2788 8d3dbe577d3a
child 3010 684a0c546774
equal deleted inserted replaced
2655:48cd71bdb5cd 2656:a93ae0f6c0ad
    16 from rql import nodes
    16 from rql import nodes
    17 
    17 
    18 from cubicweb import NotAnEntity
    18 from cubicweb import NotAnEntity
    19 from cubicweb.selectors import yes, non_final_entity, nonempty_rset, none_rset
    19 from cubicweb.selectors import yes, non_final_entity, nonempty_rset, none_rset
    20 from cubicweb.selectors import require_group_compat, accepts_compat
    20 from cubicweb.selectors import require_group_compat, accepts_compat
    21 from cubicweb.appobject import AppRsetObject
    21 from cubicweb.appobject import AppObject
    22 from cubicweb.utils import UStringIO, HTMLStream
    22 from cubicweb.utils import UStringIO, HTMLStream
    23 from cubicweb.schema import display_name
    23 from cubicweb.schema import display_name
    24 
    24 
    25 # robots control
    25 # robots control
    26 NOINDEX = u'<meta name="ROBOTS" content="NOINDEX" />'
    26 NOINDEX = u'<meta name="ROBOTS" content="NOINDEX" />'
    71 STRICT_DOCTYPE = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" %s>\n' % CW_XHTML_EXTENSIONS
    71 STRICT_DOCTYPE = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" %s>\n' % CW_XHTML_EXTENSIONS
    72 STRICT_DOCTYPE_NOEXT = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'
    72 STRICT_DOCTYPE_NOEXT = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'
    73 
    73 
    74 # base view object ############################################################
    74 # base view object ############################################################
    75 
    75 
    76 class View(AppRsetObject):
    76 class View(AppObject):
    77     """abstract view class, used as base for every renderable object such
    77     """abstract view class, used as base for every renderable object such
    78     as views, templates, some components...web
    78     as views, templates, some components...web
    79 
    79 
    80     A view is instantiated to render a [part of a] result set. View
    80     A view is instantiated to render a [part of a] result set. View
    81     subclasses may be parametred using the following class attributes:
    81     subclasses may be parametred using the following class attributes:
    91     At instantiation time, the standard `req`, `rset`, and `cursor`
    91     At instantiation time, the standard `req`, `rset`, and `cursor`
    92     attributes are added and the `w` attribute will be set at rendering
    92     attributes are added and the `w` attribute will be set at rendering
    93     time to a write function to use.
    93     time to a write function to use.
    94     """
    94     """
    95     __registry__ = 'views'
    95     __registry__ = 'views'
    96     registered = require_group_compat(AppRsetObject.registered)
    96     registered = require_group_compat(AppObject.registered)
    97 
    97 
    98     templatable = True
    98     templatable = True
    99     need_navigation = True
    99     need_navigation = True
   100     # content_type = 'application/xhtml+xml' # text/xhtml'
   100     # content_type = 'application/xhtml+xml' # text/xhtml'
   101     binary = False
   101     binary = False