Skip to content
Snippets Groups Projects
Commit 5ebb8152c714 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

fix sameetype overriding

parent b34fc7161e62
No related branches found
No related tags found
No related merge requests found
......@@ -36,10 +36,11 @@
def render_entity_relations(self, entity):
super(BlogPrimaryView, self).render_entity_relations(entity)
rset = entity.related('entry_of', 'object')
strio = UStringIO()
self.paginate(self._cw, w=strio.write, page_size=10, rset=rset)
self.wview('adaptedlist', rset, 'null')
self.w(strio.getvalue())
if rset:
strio = UStringIO()
self.paginate(self._cw, w=strio.write, page_size=10, rset=rset)
self.wview('sameetypelist', rset)
self.w(strio.getvalue())
def render_entity_title(self, entity):
self.w(u'<h1>%s</h1>' % xml_escape(entity.dc_title()))
......
"""Secondary views for blogs
:organization: Logilab
:copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:copyright: 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"
......@@ -142,6 +142,6 @@
## list views ##################################################################
class BlogEntryAdaptedListView(baseviews.AdaptedListView):
__select__ = baseviews.AdaptedListView.__select__ & implements('BlogEntry')
class BlogEntrySameETypeListView(baseviews.SameETypeListView):
__select__ = baseviews.SameETypeListView.__select__ & implements('BlogEntry')
countrql = 'Any COUNT(B) WHERE B is BlogEntry, B creation_date >= %(firstday)s, B creation_date <= %(lastday)s'
......@@ -147,4 +147,5 @@
countrql = 'Any COUNT(B) WHERE B is BlogEntry, B creation_date >= %(firstday)s, B creation_date <= %(lastday)s'
item_vid = 'blog'
def call(self, **kwargs):
self._cw.add_css('cubes.blog.css')
......@@ -148,7 +149,8 @@
def call(self, **kwargs):
self._cw.add_css('cubes.blog.css')
super(BlogEntryAdaptedListView, self).call(**kwargs)
print 'yoooo'
super(BlogEntrySameETypeListView, self).call(**kwargs)
if 'year' in self._cw.form and 'month' in self._cw.form:
self.render_next_previous(int(self._cw.form['year']), int(self._cw.form['month']))
......@@ -191,10 +193,6 @@
return u'<a href="%s" title="">%s</a>' % (url, atitle)
return u''
class BlogEntryAdaptedListItemView(baseviews.AdaptedListItemView):
__select__ = baseviews.AdaptedListView.__select__ & implements('BlogEntry')
redirect_vid = 'blog'
class BlogEntryBlogView(EntityView):
__regid__ = 'blog'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment