Skip to content.

Etria Lists

 

[quills-dev] [Collective-checkins] r32139 - Quills/trunk

quills-dev at lists.etria.com quills-dev at lists.etria.com
Sat Oct 21 23:39:29 UTC 2006


Author: tomster
Date: Sat Oct 21 23:39:28 2006
New Revision: 32139

Modified:
   Quills/trunk/syndication.py
Log:
Made WeblogFeedEntry's `getModifiedDate()` aware of any comments. 

I know, I really need to write a test for this... I've tested it in pdb successfully, though ;-)

Modified: Quills/trunk/syndication.py
==============================================================================
--- Quills/trunk/syndication.py	(original)
+++ Quills/trunk/syndication.py	Sat Oct 21 23:39:28 2006
@@ -9,9 +9,9 @@
 
 # fatsyndication imports
 from Products.fatsyndication.adapters import BaseFeed, BaseFeedSource, \
-     BaseFeedEntry
+    BaseFeedEntry
 from Products.basesyndication.interfaces import IFeed, IFeedSource, \
-     IFeedEntry
+    IFeedEntry
 
 
 class WeblogFeed(BaseFeed):
@@ -109,3 +109,27 @@
         """See IFeedEntry.
         """
         return self.context.getText()
+
+    def getModifiedDate(self):
+        """See IFeedEntry.
+        """
+
+        # we override fatsyndications generic implementation and compare the 
+        # entry's modification date with those of any comments:
+        modified = self.context.getModifiedDate()
+
+        path = '/'.join(self.context.getPhysicalPath())
+        results = self.context.portal_catalog(
+            meta_type=['Discussion Item',],
+            path={'query':path, 'level': 0},
+            sort_on = 'modified',
+            sort_order = 'reverse',
+            review_state = 'published')
+
+        try:
+            comment_mod = results[0].getObject().modified()
+            if comment_mod > modified:
+                modified = comment_mod
+        except IndexError:
+             pass
+        return modified

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Collective-checkins mailing list
Collective-checkins at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/collective-checkins



More information about the quills-dev mailing list