Last change
on this file since 1239 was
649,
checked in by crchemist, 18 years ago
|
Added posibility of selection among static and dynamic captchas.
|
-
Property svn:eol-style set to
native
|
File size:
1.3 KB
|
Line | |
---|
1 | from zope.component.interface import interfaceToName |
---|
2 | from quills.core.interfaces import IPossibleWeblogEntry |
---|
3 | from quills.core.interfaces import IWeblogLocator |
---|
4 | from quills.app.interfaces import IWeblogEnhancedConfiguration |
---|
5 | from quills.app.weblogentrybrain import WeblogEntryCatalogBrain |
---|
6 | |
---|
7 | |
---|
8 | def 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 | |
---|
31 | from Products.QuillsEnabled.adapters.folder import Folder2Weblog |
---|
32 | |
---|
33 | |
---|
34 | Folder2Weblog.getEntries = getEntries |
---|
Note: See
TracBrowser
for help on using the repository browser.