~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/atom_ui.py

  • Committer: John Arbash Meinel
  • Date: 2011-03-19 08:35:57 UTC
  • mfrom: (422.3.2 head_middleware)
  • Revision ID: john@arbash-meinel.com-20110319083557-k8mbbkr3bzisz3ob
include HeadMiddleware so that we can be sure HEAD requests never return BODY content.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
    template_path = 'loggerhead.templates.atom'
26
26
 
27
 
    def get_values(self, h, args, kw, response):
28
 
        h = self._branch.history
29
 
 
 
27
    def get_values(self, path, kwargs, headers):
 
28
        history = self._history
30
29
        pagesize = int(20)#self._branch.config.get('pagesize', '20'))
31
30
 
32
 
        revid_list = h.get_file_view(h.last_revid, None)
33
 
        entries = list(h.get_changes(list(revid_list)[:pagesize]))
 
31
        revid_list = history.get_file_view(history.last_revid, None)
 
32
        entries = list(history.get_changes(list(revid_list)[:pagesize]))
34
33
 
35
 
        response.headers['Content-Type'] = 'application/atom+xml'
 
34
        headers['Content-Type'] = 'application/atom+xml'
36
35
        return {
37
36
            'changes': entries,
38
 
            'updated': entries[0].date.isoformat() + 'Z',
 
37
            'updated': entries[0].utc_date.isoformat(),
 
38
            'history': self._history,
39
39
        }