def METHOD_NAME(cls, category=None):
    categories = cls.objects.all()
    if category:
        categories = categories.filter(title=category)
    data = dict(categories=[], feeds={})
    feed_ids = set()
    for category in categories:
        category_output = {
            'title': category.title,
            'description': category.description,
            'feed_ids': category.feed_ids,
        }
        data['categories'].append(category_output)
        feed_ids.update(list(category.feed_ids))
    feeds = Feed.objects.filter(pk__in=feed_ids)
    for feed in feeds:
        data['feeds'][feed.pk] = feed.canonical()
    return data