Changeset 842

Show
Ignore:
Timestamp:
04/11/07 07:53:11
Author:
mylan
Message:

Remove needless collectEntries method from SimpleblogTool? and simpleblog_standalone template.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • SimpleBlog/branches/optimizations/SimpleBlogTool.py

    r841 r842  
    245245            return results[:maxResults]     
    246246 
    247  
    248     security.declarePublic('searchForEntries') 
    249     def collectEntries(self, context, category=None, maxResults=None,  filterState=1, allBlogs=0, **kwargs): 
    250         # first get all the blogs 
    251         if allBlogs: 
    252             query = {'meta_type':'Blog', 
    253                         'path':{'query':self.getObjectPath(context),'level':0} 
    254                         } # used meta_type because for some reason, syndication objects also show up. 
    255             blogs = [b.getObject() for b in self.portal_catalog.searchResults(query)] 
    256             onTop=[] 
    257             atBottom=[] 
    258             # now collect all the entries 
    259             for blog in blogs: 
    260                 tmpTop, tmpBottom = blog.getEntries(category=category, maxResults=maxResults, filterState = filterState, sort=0, **kwargs) 
    261                 onTop = onTop+tmpTop 
    262                 atBottom = atBottom+tmpBottom 
    263             #sort 
    264             onTop.sort((lambda x,y:cmp(y.effective(), x.effective()))) 
    265             atBottom.sort((lambda x,y:cmp(y.effective(), x.effective()))) 
    266  
    267             results = onTop+atBottom 
    268         else: 
    269             results = context.getEntries(category=category, maxResults=maxResults, filterState = filterState, sort=0, join=1, skipOnTop=1, **kwargs) 
    270  
    271         if maxResults==0: 
    272             return results 
    273         elif maxResults==None: 
    274             return results[:self._getMaxItemsInPortlet()] 
    275         else: 
    276             return results[:maxResults] 
    277247 
    278248    security.declarePublic('searchForDay') 
  • SimpleBlog/branches/optimizations/docs/readme.txt

    r694 r842  
    115115will be sufficient. 
    116116 
    117 Using SimpleBlog as your homepage in Plone 
    118  
    119     Inside the skin folder there is a template called **simpleblog_standalone**. First get rid of the current index_html 
    120 in your portal root by deleting it or renaming it. Then create a new Page template in the root and call it index_html. 
    121 Then copy/paste the code from simpleblog_standalone in there and adjust it at will. All this is done in ZMI. 
    122  
    123117Well, that's all you have to know to set up SimpleBlog. Enjoy it. 
    124118