def collection_detail_json(request, username, slug): c = get_collection(request, username, slug) if not (c.listed or acl.check_collection_ownership(request, c)): raise PermissionDenied # We evaluate the QuerySet with `list` to work around bug 866454. addons_dict = [addon_to_dict(a) for a in list(c.addons.valid())] return { 'name': c.name, 'url': c.get_abs_url(), 'iconUrl': c.icon_url, 'addons': addons_dict }
def render_json(self, context): return json.dumps([addon_to_dict(a) for a in context['addons']], cls=JSONEncoder)
def render_json(self, context): return json.dumps(addon_to_dict(context['addon']), cls=JSONEncoder)