author | Florent <florent@secondweb.fr> |
Tue, 19 May 2009 17:05:54 +0200 | |
branch | stable |
changeset 1873 | e96f50e52099 |
parent 1760 | 6b97d286eb5a |
child 1882 | ce662160bb46 |
permissions | -rw-r--r-- |
0 | 1 |
"""Set of HTML generic base views: |
2 |
||
3 |
* noresult, final |
|
4 |
* primary, sidebox |
|
5 |
* secondary, oneline, incontext, outofcontext, text |
|
6 |
* list |
|
7 |
||
8 |
||
9 |
:organization: Logilab |
|
479 | 10 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
0 | 11 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
12 |
""" |
|
964
a711c7c185d1
gargl, this shouldn't be there in case we're running py 2.4
sylvain.thenault@logilab.fr
parents:
958
diff
changeset
|
13 |
#from __future__ import with_statement |
958
6053622aae81
fix name error, filter out non empty rset
sylvain.thenault@logilab.fr
parents:
956
diff
changeset
|
14 |
|
0 | 15 |
__docformat__ = "restructuredtext en" |
16 |
||
17 |
from rql import nodes |
|
18 |
||
1680
39860636e184
use xml_escape
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1653
diff
changeset
|
19 |
from logilab.mtconverter import TransformError, html_escape, xml_escape |
0 | 20 |
|
1491
742aff97dbf7
move AutomaticEntityForm and PrimaryView into their own module
sylvain.thenault@logilab.fr
parents:
1477
diff
changeset
|
21 |
from cubicweb import NoSelectableObject |
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
22 |
from cubicweb.selectors import yes, empty_rset |
756 | 23 |
from cubicweb.view import EntityView, AnyRsetView, View |
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
24 |
from cubicweb.common.uilib import cut, printable_value |
0 | 25 |
|
26 |
_ = unicode |
|
27 |
||
28 |
class NullView(AnyRsetView): |
|
29 |
"""default view when no result has been found""" |
|
30 |
id = 'null' |
|
758
0c0dfd33a76d
instantiate selectors wherever needed
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
742
diff
changeset
|
31 |
__select__ = yes() |
0 | 32 |
def call(self, **kwargs): |
33 |
pass |
|
34 |
cell_call = call |
|
35 |
||
36 |
||
632 | 37 |
class NoResultView(View): |
0 | 38 |
"""default view when no result has been found""" |
742
99115e029dca
replaced most of __selectors__ assignments with __select__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
647
diff
changeset
|
39 |
__select__ = empty_rset() |
0 | 40 |
id = 'noresult' |
1451 | 41 |
|
0 | 42 |
def call(self, **kwargs): |
43 |
self.w(u'<div class="searchMessage"><strong>%s</strong></div>\n' |
|
44 |
% self.req._('No result matching query')) |
|
45 |
||
46 |
||
47 |
class FinalView(AnyRsetView): |
|
48 |
"""display values without any transformation (i.e. get a number for |
|
1451 | 49 |
entities) |
0 | 50 |
""" |
51 |
id = 'final' |
|
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
52 |
# record generated i18n catalog messages |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
53 |
_('%d years') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
54 |
_('%d months') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
55 |
_('%d weeks') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
56 |
_('%d days') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
57 |
_('%d hours') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
58 |
_('%d minutes') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
59 |
_('%d seconds') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
60 |
_('%d years') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
61 |
_('%d months') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
62 |
_('%d weeks') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
63 |
_('%d days') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
64 |
_('%d hours') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
65 |
_('%d minutes') |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
66 |
_('%d seconds') |
1451 | 67 |
|
573
9c8fd72ba6c1
try to get raw text values in rset csv view
sylvain.thenault@logilab.fr
parents:
570
diff
changeset
|
68 |
def cell_call(self, row, col, props=None, displaytime=False, format='text/html'): |
0 | 69 |
etype = self.rset.description[row][col] |
70 |
value = self.rset.rows[row][col] |
|
1760
6b97d286eb5a
[reledit] relation edition : cleanup a bit #343123
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1712
diff
changeset
|
71 |
|
0 | 72 |
if etype == 'String': |
73 |
entity, rtype = self.rset.related_entity(row, col) |
|
74 |
if entity is not None: |
|
75 |
# yes ! |
|
573
9c8fd72ba6c1
try to get raw text values in rset csv view
sylvain.thenault@logilab.fr
parents:
570
diff
changeset
|
76 |
self.w(entity.printable_value(rtype, value, format=format)) |
0 | 77 |
return |
78 |
if etype in ('Time', 'Interval'): |
|
1451 | 79 |
# value is DateTimeDelta but we have no idea about what is the |
0 | 80 |
# reference date here, so we can only approximate years and months |
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
81 |
if format == 'text/html': |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
82 |
space = ' ' |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
83 |
else: |
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
84 |
space = ' ' |
0 | 85 |
if value.days > 730: # 2 years |
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
86 |
self.w(self.req.__('%%d%syears' % space) % (value.days // 365)) |
0 | 87 |
elif value.days > 60: # 2 months |
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
88 |
self.w(self.req.__('%%d%smonths' % space) % (value.days // 30)) |
0 | 89 |
elif value.days > 14: # 2 weeks |
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
90 |
self.w(self.req.__('%%d%sweeks' % space) % (value.days // 7)) |
0 | 91 |
elif value.days > 2: |
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
92 |
self.w(self.req.__('%%d%sdays' % space) % int(value.days)) |
1712
32ab85031814
fix a bug deltatime hasn't a hours or minutes attributes
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1680
diff
changeset
|
93 |
elif value.seconds > 3600: |
32ab85031814
fix a bug deltatime hasn't a hours or minutes attributes
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1680
diff
changeset
|
94 |
self.w(self.req.__('%%d%shours' % space) % int(value.seconds // 3600)) |
32ab85031814
fix a bug deltatime hasn't a hours or minutes attributes
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1680
diff
changeset
|
95 |
elif value.seconds >= 120: |
32ab85031814
fix a bug deltatime hasn't a hours or minutes attributes
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1680
diff
changeset
|
96 |
self.w(self.req.__('%%d%sminutes' % space) % int(value.seconds // 60)) |
0 | 97 |
else: |
978
536c748e7b3f
use non-breakable space in time display
sylvain.thenault@logilab.fr
parents:
964
diff
changeset
|
98 |
self.w(self.req.__('%%d%sseconds' % space) % int(value.seconds)) |
0 | 99 |
return |
100 |
self.wdata(printable_value(self.req, etype, value, props, displaytime=displaytime)) |
|
101 |
||
102 |
||
103 |
class SecondaryView(EntityView): |
|
104 |
id = 'secondary' |
|
105 |
title = _('secondary') |
|
1451 | 106 |
|
0 | 107 |
def cell_call(self, row, col): |
108 |
"""the secondary view for an entity |
|
109 |
secondary = icon + view(oneline) |
|
110 |
""" |
|
111 |
entity = self.entity(row, col) |
|
112 |
self.w(u' ') |
|
113 |
self.wview('oneline', self.rset, row=row, col=col) |
|
114 |
||
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
115 |
|
0 | 116 |
class OneLineView(EntityView): |
117 |
id = 'oneline' |
|
1451 | 118 |
title = _('oneline') |
0 | 119 |
|
120 |
def cell_call(self, row, col): |
|
121 |
"""the one line view for an entity: linked text view |
|
122 |
""" |
|
123 |
entity = self.entity(row, col) |
|
124 |
self.w(u'<a href="%s">' % html_escape(entity.absolute_url())) |
|
125 |
self.w(html_escape(self.view('text', self.rset, row=row, col=col))) |
|
126 |
self.w(u'</a>') |
|
127 |
||
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
128 |
|
0 | 129 |
class TextView(EntityView): |
532
ce3e94cbb074
specify content type for text views
sylvain.thenault@logilab.fr
parents:
531
diff
changeset
|
130 |
"""the simplest text view for an entity""" |
0 | 131 |
id = 'text' |
132 |
title = _('text') |
|
532
ce3e94cbb074
specify content type for text views
sylvain.thenault@logilab.fr
parents:
531
diff
changeset
|
133 |
content_type = 'text/plain' |
647
49bb57a9606b
some selectors update + drop EntityRelationView (only used by jpl)
sylvain.thenault@logilab.fr
parents:
632
diff
changeset
|
134 |
|
0 | 135 |
def call(self, **kwargs): |
136 |
"""the view is called for an entire result set, by default loop |
|
137 |
other rows of the result set and call the same view on the |
|
138 |
particular row |
|
139 |
||
140 |
Views applicable on None result sets have to override this method |
|
141 |
""" |
|
142 |
rset = self.rset |
|
143 |
if rset is None: |
|
144 |
raise NotImplementedError, self |
|
145 |
for i in xrange(len(rset)): |
|
146 |
self.wview(self.id, rset, row=i, **kwargs) |
|
147 |
if len(rset) > 1: |
|
148 |
self.w(u"\n") |
|
1451 | 149 |
|
0 | 150 |
def cell_call(self, row, col=0, **kwargs): |
151 |
entity = self.entity(row, col) |
|
152 |
self.w(cut(entity.dc_title(), |
|
153 |
self.req.property_value('navigation.short-line-size'))) |
|
154 |
||
137
7e45cf48c2f1
don't display additional owners in metadata, this is confusing
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents:
0
diff
changeset
|
155 |
|
0 | 156 |
class MetaDataView(EntityView): |
157 |
"""paragraph view of some metadata""" |
|
158 |
id = 'metadata' |
|
159 |
show_eid = True |
|
1451 | 160 |
|
0 | 161 |
def cell_call(self, row, col): |
162 |
_ = self.req._ |
|
163 |
entity = self.entity(row, col) |
|
164 |
self.w(u'<div class="metadata">') |
|
165 |
if self.show_eid: |
|
166 |
self.w(u'#%s - ' % entity.eid) |
|
167 |
if entity.modification_date != entity.creation_date: |
|
168 |
self.w(u'<span>%s</span> ' % _('latest update on')) |
|
1552 | 169 |
self.w(u'<span class="value">%s</span>, ' |
0 | 170 |
% self.format_date(entity.modification_date)) |
171 |
# entities from external source may not have a creation date (eg ldap) |
|
1451 | 172 |
if entity.creation_date: |
0 | 173 |
self.w(u'<span>%s</span> ' % _('created on')) |
174 |
self.w(u'<span class="value">%s</span>' |
|
175 |
% self.format_date(entity.creation_date)) |
|
176 |
if entity.creator: |
|
1456
998ff29c3390
related entitied must be computed in _preinit_side_related
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
1431
diff
changeset
|
177 |
self.w(u' <span>%s</span> ' % _('by')) |
0 | 178 |
self.w(u'<span class="value">%s</span>' % entity.creator.name()) |
179 |
self.w(u'</div>') |
|
180 |
||
181 |
||
182 |
# new default views for finner control in general views , to use instead of |
|
183 |
# oneline / secondary |
|
184 |
||
185 |
class InContextTextView(TextView): |
|
186 |
id = 'textincontext' |
|
187 |
title = None # not listed as a possible view |
|
188 |
def cell_call(self, row, col): |
|
189 |
entity = self.entity(row, col) |
|
190 |
self.w(entity.dc_title()) |
|
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
191 |
|
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
192 |
|
0 | 193 |
class OutOfContextTextView(InContextTextView): |
194 |
id = 'textoutofcontext' |
|
195 |
||
196 |
def cell_call(self, row, col): |
|
197 |
entity = self.entity(row, col) |
|
198 |
self.w(entity.dc_long_title()) |
|
199 |
||
200 |
||
201 |
class InContextView(EntityView): |
|
202 |
id = 'incontext' |
|
203 |
||
204 |
def cell_call(self, row, col): |
|
205 |
entity = self.entity(row, col) |
|
206 |
desc = cut(entity.dc_description(), 50) |
|
207 |
self.w(u'<a href="%s" title="%s">' % (html_escape(entity.absolute_url()), |
|
208 |
html_escape(desc))) |
|
209 |
self.w(html_escape(self.view('textincontext', self.rset, row=row, col=col))) |
|
210 |
self.w(u'</a>') |
|
211 |
||
1451 | 212 |
|
0 | 213 |
class OutOfContextView(EntityView): |
214 |
id = 'outofcontext' |
|
215 |
||
216 |
def cell_call(self, row, col): |
|
217 |
self.w(u'<a href="%s">' % self.entity(row, col).absolute_url()) |
|
218 |
self.w(html_escape(self.view('textoutofcontext', self.rset, row=row, col=col))) |
|
219 |
self.w(u'</a>') |
|
220 |
||
221 |
||
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
222 |
# list views ################################################################## |
0 | 223 |
|
224 |
class ListView(EntityView): |
|
225 |
id = 'list' |
|
226 |
title = _('list') |
|
227 |
item_vid = 'listitem' |
|
1451 | 228 |
|
0 | 229 |
def call(self, klass=None, title=None, subvid=None, listid=None, **kwargs): |
230 |
"""display a list of entities by calling their <item_vid> view |
|
1451 | 231 |
|
0 | 232 |
:param listid: the DOM id to use for the root element |
233 |
""" |
|
234 |
if subvid is None and 'subvid' in self.req.form: |
|
235 |
subvid = self.req.form.pop('subvid') # consume it |
|
236 |
if listid: |
|
237 |
listid = u' id="%s"' % listid |
|
238 |
else: |
|
239 |
listid = u'' |
|
240 |
if title: |
|
241 |
self.w(u'<div%s class="%s"><h4>%s</h4>\n' % (listid, klass or 'section', title)) |
|
242 |
self.w(u'<ul>\n') |
|
243 |
else: |
|
244 |
self.w(u'<ul%s class="%s">\n' % (listid, klass or 'section')) |
|
245 |
for i in xrange(self.rset.rowcount): |
|
246 |
self.cell_call(row=i, col=0, vid=subvid, **kwargs) |
|
247 |
self.w(u'</ul>\n') |
|
248 |
if title: |
|
249 |
self.w(u'</div>\n') |
|
250 |
||
251 |
def cell_call(self, row, col=0, vid=None, **kwargs): |
|
252 |
self.w(u'<li>') |
|
253 |
self.wview(self.item_vid, self.rset, row=row, col=col, vid=vid, **kwargs) |
|
254 |
self.w(u'</li>\n') |
|
255 |
||
256 |
def url(self): |
|
257 |
"""overrides url method so that by default, the view list is called |
|
258 |
with sorted entities |
|
259 |
""" |
|
260 |
coltypes = self.rset.column_types(0) |
|
261 |
# don't want to generate the rql if there is some restriction on |
|
262 |
# something else than the entity type |
|
263 |
if len(coltypes) == 1: |
|
264 |
# XXX norestriction is not correct here. For instance, in cases like |
|
265 |
# Any P,N WHERE P is Project, P name N |
|
266 |
# norestriction should equal True |
|
267 |
restr = self.rset.syntax_tree().children[0].where |
|
268 |
norestriction = (isinstance(restr, nodes.Relation) and |
|
269 |
restr.is_types_restriction()) |
|
270 |
if norestriction: |
|
271 |
etype = iter(coltypes).next() |
|
272 |
return self.build_url(etype.lower(), vid=self.id) |
|
273 |
if len(self.rset) == 1: |
|
274 |
entity = self.rset.get_entity(0, 0) |
|
275 |
return self.build_url(entity.rest_path(), vid=self.id) |
|
276 |
return self.build_url(rql=self.rset.printable_rql(), vid=self.id) |
|
277 |
||
1451 | 278 |
|
0 | 279 |
class ListItemView(EntityView): |
280 |
id = 'listitem' |
|
1451 | 281 |
|
0 | 282 |
@property |
283 |
def redirect_vid(self): |
|
284 |
if self.req.search_state[0] == 'normal': |
|
285 |
return 'outofcontext' |
|
286 |
return 'outofcontext-search' |
|
1451 | 287 |
|
0 | 288 |
def cell_call(self, row, col, vid=None, **kwargs): |
289 |
if not vid: |
|
290 |
vid = self.redirect_vid |
|
291 |
try: |
|
292 |
self.wview(vid, self.rset, row=row, col=col, **kwargs) |
|
293 |
except NoSelectableObject: |
|
294 |
if vid == self.redirect_vid: |
|
295 |
raise |
|
296 |
self.wview(self.redirect_vid, self.rset, row=row, col=col, **kwargs) |
|
297 |
||
298 |
||
299 |
class SimpleListView(ListItemView): |
|
300 |
"""list without bullets""" |
|
301 |
id = 'simplelist' |
|
302 |
redirect_vid = 'incontext' |
|
303 |
||
304 |
||
305 |
class CSVView(SimpleListView): |
|
306 |
id = 'csv' |
|
307 |
redirect_vid = 'incontext' |
|
1451 | 308 |
|
0 | 309 |
def call(self, **kwargs): |
310 |
rset = self.rset |
|
311 |
for i in xrange(len(rset)): |
|
312 |
self.cell_call(i, 0, vid=kwargs.get('vid')) |
|
313 |
if i < rset.rowcount-1: |
|
314 |
self.w(u", ") |
|
315 |
||
316 |
||
317 |
class TreeItemView(ListItemView): |
|
318 |
id = 'treeitem' |
|
319 |
||
320 |
def cell_call(self, row, col): |
|
321 |
self.wview('incontext', self.rset, row=row, col=col) |
|
322 |
||
323 |
class TextSearchResultView(EntityView): |
|
324 |
"""this view is used to display full-text search |
|
325 |
||
326 |
It tries to highlight part of data where the search word appears. |
|
327 |
||
328 |
XXX: finish me (fixed line width, fixed number of lines, CSS, etc.) |
|
329 |
""" |
|
330 |
id = 'tsearch' |
|
331 |
||
332 |
def cell_call(self, row, col, **kwargs): |
|
333 |
entity = self.complete_entity(row, col) |
|
334 |
self.w(entity.view('incontext')) |
|
335 |
searched = self.rset.searched_text() |
|
336 |
if searched is None: |
|
337 |
return |
|
338 |
searched = searched.lower() |
|
339 |
highlighted = '<b>%s</b>' % searched |
|
340 |
for attr in entity.e_schema.indexable_attributes(): |
|
341 |
try: |
|
1680
39860636e184
use xml_escape
Graziella Toutoungis <graziella.toutoungis@logilab.fr>
parents:
1653
diff
changeset
|
342 |
value = xml_escape(entity.printable_value(attr, format='text/plain').lower()) |
0 | 343 |
except TransformError, ex: |
344 |
continue |
|
345 |
except: |
|
346 |
continue |
|
347 |
if searched in value: |
|
348 |
contexts = [] |
|
349 |
for ctx in value.split(searched): |
|
350 |
if len(ctx) > 30: |
|
351 |
contexts.append(u'...' + ctx[-30:]) |
|
352 |
else: |
|
353 |
contexts.append(ctx) |
|
354 |
value = u'\n' + highlighted.join(contexts) |
|
1451 | 355 |
self.w(value.replace('\n', '<br/>')) |
0 | 356 |
|
357 |
||
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
358 |
class TooltipView(EntityView): |
0 | 359 |
"""A entity view used in a tooltip""" |
360 |
id = 'tooltip' |
|
361 |
def cell_call(self, row, col): |
|
362 |
self.wview('oneline', self.rset, row=row, col=col) |
|
363 |
||
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
364 |
|
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
365 |
# XXX bw compat |
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
366 |
|
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
367 |
from logilab.common.deprecation import class_moved |
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
368 |
|
0 | 369 |
try: |
370 |
from cubicweb.web.views.tableview import TableView |
|
371 |
TableView = class_moved(TableView) |
|
372 |
except ImportError: |
|
373 |
pass # gae has no tableview module (yet) |
|
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
374 |
|
1491
742aff97dbf7
move AutomaticEntityForm and PrimaryView into their own module
sylvain.thenault@logilab.fr
parents:
1477
diff
changeset
|
375 |
from cubicweb.web.views import boxes, xmlrss, primary |
742aff97dbf7
move AutomaticEntityForm and PrimaryView into their own module
sylvain.thenault@logilab.fr
parents:
1477
diff
changeset
|
376 |
PrimaryView = class_moved(primary.PrimaryView) |
824
a5e6acffde30
merge, split baseviews (new csvexport, xmlrss and editviews modules)
sylvain.thenault@logilab.fr
parents:
795
diff
changeset
|
377 |
SideBoxView = class_moved(boxes.SideBoxView) |
1653 | 378 |
XmlView = class_moved(xmlrss.XMLView) |
379 |
XmlItemView = class_moved(xmlrss.XMLItemView) |
|
380 |
XmlRsetView = class_moved(xmlrss.XMLRsetView) |
|
381 |
RssView = class_moved(xmlrss.RSSView) |
|
382 |
RssItemView = class_moved(xmlrss.RSSItemView) |
|
1451 | 383 |