fix #656178: dc_date of a blog entry should consider creation_date to behave nicely with rss aggregators
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 12 Feb 2010 10:07:03 +0100
changeset 166 d481b1bd5dac
parent 165 44a35ca8eda2
child 168 901959b5b867
child 175 df29eff84bec
fix #656178: dc_date of a blog entry should consider creation_date to behave nicely with rss aggregators
entities.py
--- a/entities.py	Fri Feb 12 10:01:29 2010 +0100
+++ b/entities.py	Fri Feb 12 10:07:03 2010 +0100
@@ -51,6 +51,10 @@
     def dc_description(self, format='text/plain'):
         return self.printable_value('content', format=format)
 
+    def dc_date(self, date_format=None):# XXX default to ISO 8601 ?
+        """return latest modification date of this entity"""
+        return self._cw.format_date(self.creation_date, date_format=date_format)
+
     def parent(self):
         return self.entry_of and self.entry_of[0] or None