~james-w/python-oops-tools/recent-oopses

« back to all changes in this revision

Viewing changes to src/oopstools/oops/views.py

  • Committer: James Westby
  • Date: 2014-01-30 20:28:01 UTC
  • Revision ID: james.westby@canonical.com-20140130202801-8kuiv3dbl8l2zp7a
Revert to old python syntax until tests are run on a modern python.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
        ORDER BY date DESC
110
110
        LIMIT 50;
111
111
    """, [prefix_ids]))
112
 
    infestation_pks = set(oops.oopsinfestation_id for oops in recent_oopses)
 
112
    infestation_pks = set([oops.oopsinfestation_id for oops in recent_oopses])
113
113
    infestations = Infestation.objects.filter(id__in=infestation_pks).all()
114
 
    exception_types = {i.id: i.exception_type for i in infestations}
 
114
    exception_types = dict([(i.id, i.exception_type) for i in infestations])
115
115
    return [(oops, exception_types[oops.oopsinfestation_id]) for oops in recent_oopses]
116
116
 
117
117