# HG changeset patch
# User sylvain.thenault@logilab.fr
# Date 1233325585 -3600
# Node ID 60bd171ecd04ced679e132e0b810c3495d87df1d
# Parent 6ceb0c3016dfc8ed1f4a34d719bf965f5370c658
give row when selecting/dispatching content navigation component
diff -r 6ceb0c3016df -r 60bd171ecd04 web/views/baseviews.py
--- a/web/views/baseviews.py Fri Jan 30 15:25:26 2009 +0100
+++ b/web/views/baseviews.py Fri Jan 30 15:26:25 2009 +0100
@@ -13,6 +13,7 @@
"""
__docformat__ = "restructuredtext en"
+from warnings import warn
from time import timezone
from rql import nodes
@@ -143,12 +144,7 @@
self.w(u'
')
self.render_entity_attributes(entity, siderelations)
self.w(u'
')
- self.w(u'')
- for comp in self.vreg.possible_vobjects('contentnavigation',
- self.req, self.rset,
- view=self, context='navcontenttop'):
- comp.dispatch(w=self.w, view=self)
- self.w(u'
')
+ self.content_navigation_components('navcontenttop')
if self.main_related_section:
self.render_entity_relations(entity, siderelations)
self.w(u'')
@@ -158,13 +154,21 @@
self.w(u'')
self.w(u'')
self.w(u'')
- self.w(u'')
+ self.content_navigation_components('navcontentbottom')
+
+ def content_navigation_components(self, context):
+ self.w(u'
' % context)
for comp in self.vreg.possible_vobjects('contentnavigation',
- self.req, self.rset,
- view=self, context='navcontentbottom'):
- comp.dispatch(w=self.w, view=self)
+ self.req, self.rset, row=self.row,
+ view=self, context=context):
+ try:
+ comp.dispatch(w=self.w, row=self.row, view=self)
+ except NotImplementedError:
+ warn('component %s doesnt implement cell_call, please update'
+ % comp.__class__, DeprecationWarning)
+ comp.dispatch(w=self.w, view=self)
self.w(u'
')
-
+
def iter_attributes(self, entity):
for rschema, targetschema in entity.e_schema.attribute_definitions():
attr = rschema.type