Changeset 1389 for trunk/LeMillTool.py


Ignore:
Timestamp:
02/21/07 15:20:19 (13 years ago)
Author:
jukka
Message:

Closed #1146, changed front page to use collections instead of stories. Other fixes here and there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LeMillTool.py

    r1379 r1389  
    186186        return stri 
    187187 
    188     def getStoryCandidate(self, only_with_story=False): 
     188    def getStoryCandidate(self, only_with_story=True): 
    189189        """ Random pick for one content, method and tool or story if only_with_story """ 
    190190        pc=getToolByName(self, 'portal_catalog') 
    191         if GOOD_STORIES_ONLY or only_with_story: 
    192             stories=pc({'portal_type':'Story', 'review_state':'public'}) 
     191        if GOOD_STORIES_ONLY and only_with_story: 
     192            stories=pc({'getGoodStory':True}) 
     193            if not stories: 
     194                return self.getStoryCandidate(only_with_story=False) 
    193195            story=choice(stories) 
    194196            story=story.getObject() 
    195197            content=story.getRelatedContent() 
    196             method=story.getRelatedActivities() 
     198            method=story.getRelatedMethods() 
    197199            tool=story.getRelatedTools() 
    198200            if content: 
Note: See TracChangeset for help on using the changeset viewer.