- k = o.mp3_status, o.get_mp3_status_display()
- objects_by_status.setdefault(k, []).append(o)
- if o.ogg_status and o.ogg_status != o.mp3_status:
- k = o.ogg_status, o.get_ogg_status_display()
- objects_by_status.setdefault(k, []).append(o)
+ statuses.add((o.mp3_status, o.get_mp3_status_display()))
+ if o.ogg_status:
+ statuses.add((o.ogg_status, o.get_ogg_status_display()))
+ if o.youtube_status:
+ statuses.add((o.youtube_status, o.get_youtube_status_display()))
+ for status in statuses:
+ objects_by_status.setdefault(status, []).append(o)