Mezzanine BlogCategory parsing categories
问题 I want to build a custom filter that takes a blog_post as an argument and does some parsing of the categories (attached to the blog post). I tried like this: from mezzanine import template from mezzanine.blog.models import BlogPost, BlogCategory register = template.Library() @register.filter(name='has_friends') def has_friends(blog_post): categories = blog_post.categories.all() if 'Friends' in categories: return False else: return True The problem is that blog_post.categories.all() returns