# HG changeset patch
# User sylvain.thenault@logilab.fr
# Date 1242054094 -7200
# Node ID cec526a96535113e612b5a6d3e91367ddf09a78e
# Parent ee3ca4745fc30b9a9bc85deeb2a14f8e61961d07
fix 'render' method name conflict
diff -r ee3ca4745fc3 -r cec526a96535 web/htmlwidgets.py
--- a/web/htmlwidgets.py Mon May 11 16:28:42 2009 +0200
+++ b/web/htmlwidgets.py Mon May 11 17:01:34 2009 +0200
@@ -278,7 +278,7 @@
attrs = ('%s="%s"' % (name, value) for name, value in attrs.iteritems())
self.w(u'
' % (' '.join(attrs)))
for cellvid, colindex in column.cellrenderers:
- self.model.render(cellvid, rowindex, colindex, w=self.w)
+ self.model.render_cell(cellvid, rowindex, colindex, w=self.w)
self.w(u' | ')
self.w(u'')
self.w(u'')
diff -r ee3ca4745fc3 -r cec526a96535 web/views/tableview.py
--- a/web/views/tableview.py Mon May 11 16:28:42 2009 +0200
+++ b/web/views/tableview.py Mon May 11 17:01:34 2009 +0200
@@ -221,7 +221,7 @@
return columns
- def render(self, cellvid, row, col, w):
+ def render_cell(self, cellvid, row, col, w):
self.view('cell', self.rset, row=row, col=col, cellvid=cellvid, w=w)
def get_rows(self):
diff -r ee3ca4745fc3 -r cec526a96535 web/views/timeline.py
--- a/web/views/timeline.py Mon May 11 16:28:42 2009 +0200
+++ b/web/views/timeline.py Mon May 11 17:01:34 2009 +0200
@@ -29,7 +29,7 @@
__select__ = implements(ICalendarable)
date_fmt = '%Y/%m/%d'
-
+
def call(self):
events = []
for entity in self.rset.entities():
@@ -43,13 +43,13 @@
# FIXME: those properties should be defined by the entity class
def onclick_url(self, entity):
return entity.absolute_url()
-
+
def onclick(self, entity):
url = self.onclick_url(entity)
if url:
return u"javascript: document.location.href='%s'" % url
return None
-
+
def build_event(self, entity):
"""converts `entity` into a JSON object
{'start': '1891',
@@ -77,13 +77,13 @@
event_data['end'] = stop.strftime(self.date_fmt)
return event_data
-
+
class TimelineViewMixIn(object):
widget_class = 'TimelineWidget'
jsfiles = ('cubicweb.timeline-bundle.js', 'cubicweb.widgets.js',
'cubicweb.timeline-ext.js', 'cubicweb.ajax.js')
-
- def render(self, loadurl, tlunit=None):
+
+ def render_url(self, loadurl, tlunit=None):
tlunit = tlunit or self.req.form.get('tlunit')
self.req.add_js(self.jsfiles)
self.req.add_css('timeline-bundle.css')
@@ -107,15 +107,15 @@
self.req.html_headers.define_var('Timeline_urlPrefix', self.req.datadir_url)
rql = self.rset.printable_rql()
loadurl = self.build_url(rql=rql, vid='timeline-json')
- self.render(loadurl, tlunit)
-
-
+ self.render_url(loadurl, tlunit)
+
+
class StaticTimelineView(TimelineViewMixIn, StartupView):
"""similar to `TimelineView` but loads data from a static
JSON file instead of one after a RQL query.
"""
id = 'static-timeline'
-
+
def call(self, loadurl, tlunit=None, wdgclass=None):
self.widget_class = wdgclass or self.widget_class
- self.render(loadurl, tlunit)
+ self.render_url(loadurl, tlunit)