Explicative comment about the Type[M] annotation

This commit is contained in:
Martin Pépin 2020-01-03 17:29:55 +01:00
parent e45ee3fb40
commit a259b04d9c
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -28,6 +28,8 @@ class ModelSearch(Generic[M]):
>>> user_search.search(["toto", "foo"]) # returns a queryset of Users
"""
# This says that `model` is the class corresponding to the type variable M (or a
# subclass).
model: Type[M]
search_fields: Iterable[str]