source: products/qPloneGoogleSitemaps/trunk/browser/newssitemapview.py

Last change on this file was 458, checked in by fenix, 13 years ago

qPloneResolveUID import

  • Property svn:eol-style set to native
File size: 798 bytes
Line 
1from DateTime import DateTime
2from commonview import *
3
4class NewsSitemapView(CommonSitemapView):
5    """
6    Mobile Sitemap browser view
7    """
8    implements(ISitemapView)
9
10    additional_maps = (
11        ('publication_date', lambda x:DateTime(x.EffectiveDate).HTML4()),
12        ('keywords', lambda x:', '.join(x.Subject))
13    )
14
15    def getFilteredObjects(self):
16        path = self.portal.getPhysicalPath()
17        portal_types = self.context.getPortalTypes()
18        review_states = self.context.getStates()
19        min_date = DateTime() - 3
20        res = self.portal_catalog(path = path,
21                portal_type = portal_types,
22                review_state = review_states,
23                effective = {"query": min_date,
24                             "range": "min" })
25        return res
Note: See TracBrowser for help on using the repository browser.