-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.0.3 regression] GenericRelation
has no attribute
#2299
Labels
bug
Something isn't working
Comments
sobolevn
added a commit
that referenced
this issue
Jul 31, 2024
This is not a fix, but a workaround for #2299 We would need to add proper generic type params later.
Merged
This is a simple workaround: #2300 |
sobolevn
added a commit
that referenced
this issue
Jul 31, 2024
smkent
added a commit
to smkent/jobdb
that referenced
this issue
Jan 15, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In 5.0.3, the value of a
GenericRelation
field is given the useless type_ST
(an unbound type variable), and trying to do anything with it gives errors likeerror: "_ST" has no attribute "all" [attr-defined]
.This was introduced with b2b1afa (#2261, cc @rafonseca).
django-stubs/django-stubs/contrib/contenttypes/fields.pyi
Line 69 in d60e31e
ForeignObject
is generic and requires generic arguments. Without these generic arguments, it was previously interpreted asForeignObject[Any, Any]
but now it’s interpreted as the invalidForeignObject[Any, _ST]
.django-stubs/django-stubs/db/models/fields/related.pyi
Lines 29 to 34 in d60e31e
Complete test case
pyproject.toml
my_settings.py
my_app/__init__.py
# empty
my_app/models.py
The text was updated successfully, but these errors were encountered: