1 """abstract controler classe for CubicWeb web client |
1 """abstract controler classe for CubicWeb web client |
2 |
2 |
3 |
3 |
4 :organization: Logilab |
4 :organization: Logilab |
5 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
7 """ |
7 """ |
8 __docformat__ = "restructuredtext en" |
8 __docformat__ = "restructuredtext en" |
9 |
9 |
10 from mx.DateTime import strptime, Error as MxDTError, TimeDelta |
10 from mx.DateTime import strptime, Error as MxDTError, TimeDelta |
11 |
11 |
12 from cubicweb import typed_eid |
12 from cubicweb import typed_eid |
13 from cubicweb.common.registerers import priority_registerer |
13 from cubicweb.common.registerers import priority_registerer |
14 from cubicweb.common.selectors import match_user_group |
14 from cubicweb.common.selectors import yes, require_group_compat |
15 from cubicweb.common.appobject import AppObject |
15 from cubicweb.common.appobject import AppObject |
16 from cubicweb.web import LOGGER, Redirect, RequestError |
16 from cubicweb.web import LOGGER, Redirect, RequestError |
17 |
17 |
18 |
18 |
19 NAVIGATION_PARAMETERS = (('vid', '__redirectvid'), |
19 NAVIGATION_PARAMETERS = (('vid', '__redirectvid'), |
66 a request. There is usually at least one standard "view" controller |
66 a request. There is usually at least one standard "view" controller |
67 and another linked by forms to edit objects ("edit"). |
67 and another linked by forms to edit objects ("edit"). |
68 """ |
68 """ |
69 __registry__ = 'controllers' |
69 __registry__ = 'controllers' |
70 __registerer__ = priority_registerer |
70 __registerer__ = priority_registerer |
71 __selectors__ = (match_user_group,) |
71 __selectors__ = (yes,) |
72 require_groups = () |
72 registered = require_group_compat(AppObject.registered.im_func) |
73 |
73 |
74 def __init__(self, *args, **kwargs): |
74 def __init__(self, *args, **kwargs): |
75 super(Controller, self).__init__(*args, **kwargs) |
75 super(Controller, self).__init__(*args, **kwargs) |
76 # attributes use to control after edition redirection |
76 # attributes use to control after edition redirection |
77 self._after_deletion_path = None |
77 self._after_deletion_path = None |