Python django_filters 模块,ModelChoiceFilter() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django_filters.ModelChoiceFilter()

项目:froide-campaign    作者:okfde    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.campaigns = kwargs.pop('campaigns')
        self.base_filters['campaign'] = django_filters.ModelChoiceFilter(queryset=self.campaigns,
        widget=django_filters.widgets.LinkWidget, method='filter_campaign')
        super(InformationObjectFilterSet, self).__init__(*args, **kwargs)