equal
deleted
inserted
replaced
10 from cStringIO import StringIO |
10 from cStringIO import StringIO |
11 |
11 |
12 from logilab.mtconverter import html_escape |
12 from logilab.mtconverter import html_escape |
13 |
13 |
14 from cubicweb import NotAnEntity, NoSelectableObject |
14 from cubicweb import NotAnEntity, NoSelectableObject |
15 from cubicweb.selectors import (yes, match_user_groups, implements, |
15 from cubicweb.selectors import (yes, match_user_groups, non_final_entity, |
16 nonempty_rset, none_rset) |
16 nonempty_rset, none_rset) |
17 from cubicweb.selectors import require_group_compat, accepts_compat |
17 from cubicweb.selectors import require_group_compat, accepts_compat |
18 from cubicweb.appobject import AppRsetObject |
18 from cubicweb.appobject import AppRsetObject |
19 from cubicweb.utils import UStringIO, HTMLStream |
19 from cubicweb.utils import UStringIO, HTMLStream |
20 from cubicweb.vregistry import yes_registerer |
20 from cubicweb.vregistry import yes_registerer |
320 class EntityView(View): |
320 class EntityView(View): |
321 """base class for views applying on an entity (i.e. uniform result set) |
321 """base class for views applying on an entity (i.e. uniform result set) |
322 """ |
322 """ |
323 # XXX deprecate |
323 # XXX deprecate |
324 __registerer__ = accepts_registerer |
324 __registerer__ = accepts_registerer |
325 __select__ = implements('Any') |
325 __select__ = non_final_entity() |
326 registered = accepts_compat(View.registered) |
326 registered = accepts_compat(View.registered) |
327 |
327 |
328 category = 'entityview' |
328 category = 'entityview' |
329 |
329 |
330 |
330 |
353 |
353 |
354 class EntityStartupView(EntityView): |
354 class EntityStartupView(EntityView): |
355 """base class for entity views which may also be applied to None |
355 """base class for entity views which may also be applied to None |
356 result set (usually a default rql is provided by the view class) |
356 result set (usually a default rql is provided by the view class) |
357 """ |
357 """ |
358 __select__ = none_rset() | implements('Any') |
358 __select__ = none_rset() | non_final_entity() |
359 |
359 |
360 default_rql = None |
360 default_rql = None |
361 |
361 |
362 def __init__(self, req, rset): |
362 def __init__(self, req, rset): |
363 super(EntityStartupView, self).__init__(req, rset) |
363 super(EntityStartupView, self).__init__(req, rset) |