Changeset 4134

Show
Ignore:
Timestamp:
08/12/08 11:34:35 (3 months ago)
Author:
oneirist
Message:

Fixed an issue with maximum number of items.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • detailedrssfeedplugin/ReportToDetailedRSS/ReportToDetailedRSS.py

    r4133 r4134  
    4040                'application/rss+xml', 'rss') 
    4141        return handler 
    42  
     42         
    4343    # for ClearSilver templates 
    4444    def post_process_request(self, req, template, content_type): 
     
    4646        unchanged.""" 
    4747        return (template, content_type) 
    48  
     48         
    4949    # for Genshi templates 
    5050    def post_process_request(self, req, template, data, content_type): 
     
    5252        values to the template `data` dictionary, or changing template or 
    5353        mime type. 
    54          
    55         Always returns a tuple of (template, data, content_type), even if 
    56         unchanged. 
    5754        """ 
    5855         
    5956        if template == "report.rss" and req.args.get('detailed','false') == 'true': 
     57            self.env.log.debug("Detailed Feed Requested.") 
    6058            return self.intercept_report_rss(req,data) 
    6159        return (template, data, content_type) 
     
    7775        ticket_ids = set() 
    7876        ticket_ids.update([row['resource'].id for (_, row_group) in data['row_groups'] for row in row_group]) 
     77        self.env.log.debug("Tickets in Report: %s" % ticket_ids) 
    7978         
    8079        #generate data based on the headers and the ticket ids 
     
    8988         
    9089        idstring = ','.join([str(s) for s in ticket_ids]) 
    91         limit = self.config.getint('report','items_per_page_rss',0) 
     90         
     91        #if their limit is set to '0', sqlite will return 0 rows. thus, make it -1 instead 
     92        limit = self.config.getint('report','items_per_page_rss',-1) or -1 
    9293         
    9394        #all the fields starting with 'tc_' will get printed for *all* changes. 
     
    135136            else: 
    136137                items[rowAsDict['id']] = {rowAsDict['changetime']:[rowAsDict]} 
    137          
     138        self.env.log.debug('Tickets in Feed: %s' % items.values()) 
    138139        #because we're using our own template, we can just blow away the current data structure 
    139140        # - keep the report's title, and description, and, uh, report (report is a dictionary that has an id and a resource object pointing to the report) 
    140         for key in data.keys(): 
    141             if key not in ('title','description','report','context'): 
    142                 del(data[key]) 
    143         data['items'] = items 
     141        # - context lets us use wiki_to_html 
     142        data = {'items':items, 
     143                'title':data['title'], 
     144                'description':data['description'], 
     145                'report':data['report'], 
     146                'context':data['context']} 
    144147         
    145148        return ('detailedrss.rss',data,'application/rss+xml')         
  • detailedrssfeedplugin/ReportToDetailedRSS/templates/detailedrss.rss

    r4114 r4134  
    11<?xml version="1.1"?> 
    2 <?xml-stylesheet type="text/css" href="http://localhost/trac/chrome/common/css/ticket.css"?> 
    32<rss version="2.0" xmlns:py="http://genshi.edgewall.org/" 
    43                   xmlns:xi="http://www.w3.org/2001/XInclude">