- themes = categories.get('theme', [])
- things = categories.get('thing', [])
+ # categories = SortedDict()
+ # for tag in picture.tags.iterator():
+ # categories.setdefault(tag.category, []).append(tag)
+
+ themes = theme_things.get('theme', [])
+ things = theme_things.get('thing', [])