DavisRayM / django-filter-stubs

PEP-484 stubs for django-filter
MIT License
7 stars 3 forks source link

Add parent property to Filter #17

Open palfrey opened 1 year ago

palfrey commented 1 year ago

Fixes https://github.com/DavisRayM/django-filter-stubs/issues/7

So this is slightly fiddly because Filters don't have parent declared to start with, but it gets set by FilterSet. Annoyingly they don't set a default None parent, and AFAIK there's no way in types to say "this property might not be defined" (mostly probably because that's a bad idea IMHO).

OTOH, I think it's probably ok as most people are accessing them via FilterSet work?