Skip to content

Commit a2c34cc

Browse files
authored
[django-filter] Improve stubtest comment (#14738)
1 parent da93072 commit a2c34cc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

stubs/django-filter/@tests/stubtest_allowlist.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ django_filters.fields.RangeField.__init__
1515
django_filters.filters.QuerySetRequestMixin.__init__
1616
django_filters.widgets.CSVWidget.__init__
1717

18-
# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
19-
# See https://github.com/python/typeshed/pull/14699
18+
# BaseCSVFilter constructs a custom class dynamically, which stubtest can't handle.
2019
django_filters(\.\w+)*\.OrderingFilter.field_class

stubs/django-filter/django_filters/filters.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ class LookupChoiceFilter(Filter):
292292
def filter(self, qs: QuerySet[Any], lookup: Lookup) -> QuerySet[Any]: ...
293293

294294
class OrderingFilter(BaseCSVFilter, ChoiceFilter):
295-
field_class: type[BaseCSVField] # Inherits CSV field behavior for comma-separated ordering
295+
# Inherits CSV field behavior for comma-separated ordering.
296+
# BaseCSVFilter constructs a custom ConcreteCSVField class that derives
297+
# from BaseCSVField.
298+
field_class: type[BaseCSVField]
296299
descending_fmt: str
297300
param_map: dict[str, str] | None
298301
def __init__(

0 commit comments

Comments
 (0)