site-packages/django_filters/filters.py:33
    过滤器类

    1. "AllValuesFilter",
    2. "AllValuesMultipleFilter",
    3. "BaseCSVFilter",
    4. "BaseInFilter",
    5. "BaseRangeFilter",
    6. "BooleanFilter",
    7. "CharFilter",
    8. "ChoiceFilter",
    9. "DateFilter",
    10. "DateFromToRangeFilter",
    11. "DateRangeFilter",
    12. "DateTimeFilter",
    13. "DateTimeFromToRangeFilter",
    14. "DurationFilter",
    15. "Filter",
    16. "IsoDateTimeFilter",
    17. "IsoDateTimeFromToRangeFilter",
    18. "LookupChoiceFilter",
    19. "ModelChoiceFilter",
    20. "ModelMultipleChoiceFilter",
    21. "MultipleChoiceFilter",
    22. "NumberFilter",
    23. "NumericRangeFilter",
    24. "OrderingFilter",
    25. "RangeFilter",
    26. "TimeFilter",
    27. "TimeRangeFilter",
    28. "TypedChoiceFilter",
    29. "TypedMultipleChoiceFilter",
    30. "UUIDFilter",

    过滤器类参数清单
    field_name参数,可选,默认使用过滤器的名字作为要查询的字段名
    lookup_expr参数,可选,默认使用exact作为lookup表达式

    1. class Filter:
    2. def __init__(
    3. self,
    4. field_name=None,
    5. lookup_expr=None,
    6. *,
    7. label=None,
    8. method=None,
    9. distinct=False,
    10. exclude=False,
    11. **kwargs
    12. ):
    13. if lookup_expr is None:
    14. lookup_expr = settings.DEFAULT_LOOKUP_EXPR # 默认是exact,完全匹配
    15. self.field_name = field_name
    16. self.lookup_expr = lookup_expr
    17. self.label = label
    18. self.method = method
    19. self.distinct = distinct
    20. self.exclude = exclude
    21. self.extra = kwargs
    22. self.extra.setdefault("required", False)
    23. self.creation_counter = Filter.creation_counter
    24. Filter.creation_counter += 1

    Lookups 清单(lookup_expr可以设置的值)

    1. date
    2. year
    3. month
    4. day
    5. week_day
    6. hour
    7. minute
    8. second
    9. exact
    10. iexact
    11. contains
    12. icontains
    13. in
    14. gt
    15. gte
    16. lt
    17. lte
    18. startswith
    19. istartswith
    20. endswith
    21. iendswith
    22. range
    23. isnull
    24. regex
    25. iregex
    26. search
    27. contained_by
    28. overlap
    29. has_key
    30. has_keys
    31. has_any_keys
    32. trigram_similar

    Meta类字段备忘录
    https://django-filter.readthedocs.io/en/stable/ref/filterset.html#meta-options

    1. model
    2. fields
    3. exclude
    4. form
    5. filter_overrides