This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.views.generic import ListView | |
class SimpleFilteringListView(ListView): | |
""" | |
List view with extra filtering and grouping in context data. | |
``filters`` dict is created as follows: {'context_variable_name', 'filtering_object_method_name'} | |
It calls filtering method on each object in object_list and if it returns True - this object is added | |
to proper context variable. |