allow to override is_primary result using an argument given to object constructor (have to be given to 'initargs' argument of .render like initargs={'is_primary': False}
--- a/view.py Wed Dec 02 15:08:11 2009 +0100
+++ b/view.py Wed Dec 02 16:56:28 2009 +0100
@@ -168,6 +168,7 @@
if rset is None:
raise NotImplementedError, self
wrap = self.templatable and len(rset) > 1 and self.add_div_section
+ # XXX propagate self.extra_kwars?
for i in xrange(len(rset)):
if wrap:
self.w(u'<div class="section">')
@@ -189,7 +190,7 @@
return True
def is_primary(self):
- return self.id == 'primary'
+ return self.extra_kwargs.get('is_primary', self.id == 'primary')
def url(self):
"""return the url associated with this view. Should not be