source: products/quintagroup.quills.extras/branches/no_webresults/quintagroup/quills/extras/weblogfolder_patch.py @ 1226

Last change on this file since 1226 was 649, checked in by crchemist, 17 years ago

Added posibility of selection among static and dynamic captchas.

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1from zope.component.interface import interfaceToName
2from quills.core.interfaces import IPossibleWeblogEntry
3from quills.core.interfaces import IWeblogLocator
4from quills.app.interfaces import IWeblogEnhancedConfiguration
5from quills.app.weblogentrybrain import WeblogEntryCatalogBrain
6
7
8def getEntries(self, maximum=None, offset=0, path=None):
9    """See IWeblog.
10    """
11    catalog, portal = self._setCatalog()
12    catalog._catalog.useBrains(WeblogEntryCatalogBrain)
13    weblog = IWeblogLocator(self.context).find()
14    if getattr(weblog, 'context', None):
15        # `weblog' is presumably an adapter around the real content object.
16        weblog = weblog.context
17                                       
18    weblog_config = IWeblogEnhancedConfiguration(weblog)
19    path = path or '/'.join(self.context.getPhysicalPath())
20    results = catalog(
21        object_provides=interfaceToName(portal, IPossibleWeblogEntry),
22        path={ 'query' : path,
23               'level' : 0, },
24        sort_on='effective',
25        sort_order='reverse',
26        review_state={ 'query'    : weblog_config.published_states,
27                       'operator' : 'or'})
28    return self._filter(results, maximum, offset)
29
30
31from Products.QuillsEnabled.adapters.folder import Folder2Weblog
32
33
34Folder2Weblog.getEntries = getEntries
Note: See TracBrowser for help on using the repository browser.