#33450: Integer primary key is wrongly casted to UUID when filtering
GenericRelation on model with UUID primary key.
-------------------------------------+-------------------------------------
Reporter: Santos Gallegos | Owner: Jeffrey
Type: Bug | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jeffrey):
Upon further investigation in Santos Gallegos original post, I also found
that in RelatedLookupMixin.get_prep_lookup it also part of the issue since
"target_field = self.lhs.output_field.path_infos[-1].fields[-1]" points at
TTag's primary key which is a UUID instead of TIntegration's ID. Was able
to resolve the issue by using reverse_path_infos but unsure if this is
correct. So the issue is not so much related to
https://github.com/django/django/commit/1afbc96a75bd1765a56054f57ea2d4b238af3f4d
which does the casting but that at this point of the code it thinks it
should get the ID value for TTag instead of TIntegration.
I will try to see if I can resolve the issue but wanted to share what I
found so far. Let me know what you guys think.
--
Ticket URL: <https://code.djangoproject.com/ticket/33450#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.aec2b69362aadcec3c5d490b143e93db%40djangoproject.com.