小编mer*_*tah的帖子

如何使用django-filter app中的MethodFilter?

我不知道如何在django-filter app中使用MethodFilter,我在文档中找不到它(http://django-filter.readthedocs.org/en/latest/index.html).我需要创建过滤器,使用from和to输入日期字段.您是否知道如何使用MethodFilter或其他方式执行此操作?

我有一些课:

class Product(django_filters.FilterSet):

    class Meta:
        model = Product
        fields = ['name', 'category', 'created_at]
Run Code Online (Sandbox Code Playgroud)

我有字段created_at,我想通过created_at(from和to)过滤产品.

python django django-filters

2
推荐指数
1
解决办法
3274
查看次数

标签 统计

django ×1

django-filters ×1

python ×1