mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 04:04:26 +08:00
Fix readme (#326)
This commit is contained in:
@@ -83,7 +83,7 @@ when you will try to use `QuerySet[MyModel]` or `Manager[MyModel]`.
|
||||
|
||||
This happens because Django classes do not support [`__class_getitem__`](https://www.python.org/dev/peps/pep-0560/#class-getitem) magic method.
|
||||
|
||||
You can use strings instead: `'QuerySet[MyModel]'` and `'Manager[MyModel'`, this way it will work as a type for `mypy` and as a regular `str` in runtime.
|
||||
You can use strings instead: `'QuerySet[MyModel]'` and `'Manager[MyModel]'`, this way it will work as a type for `mypy` and as a regular `str` in runtime.
|
||||
|
||||
Currently we [are working](https://github.com/django/django/pull/12405) on providing `__class_getitem__` to the classes where we need them.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user