To complete the recipe, follow these steps:
- Create IdeaFilterForm with all of the possible categories to filter by:
# myproject/apps/ideas/forms.pyfrom django import formsfrom django.utils.translation import ugettext_lazy as _from django.db import modelsfrom django.contrib.auth import get_user_modelfrom myproject.apps.categories.models import Categoryfrom .models import RATING_CHOICESUser = get_user_model()class IdeaFilterForm(forms.Form): author = forms.ModelChoiceField( label=_("Author"), required=False, queryset=User.objects.annotate( idea_count=models.Count("authored_ideas") ).filter(idea_count__gt=0), ) category = forms.ModelChoiceField( label=_("Category"), required=False, queryset=Category.objects.annotate( idea_count ...