1
0
Fork 0
forked from github/pelican

Binds the summary property to the current instance

An unbound property will just return itself instead of calling the intended
method.
This commit is contained in:
Marcus Fredriksson 2011-03-09 12:21:15 +01:00
commit f9123a4cc6

View file

@ -58,7 +58,7 @@ class Page(object):
self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode('utf')
if not hasattr(self, 'summary'):
self.summary = property(lambda self: truncate_html_words(self.content, 50))
self.summary = property(lambda self: truncate_html_words(self.content, 50)).__get__(self, Page)
# store the settings ref.
self._settings = settings