#34015: "Related Field got invalid lookup: startswith" on CharField ForeignKey
-------------------------------------+-------------------------------------
Reporter: Thomas | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: ORM lookup | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Alex Morega):
Also, Thomas, it makes sense to assume there is a JOIN in the second
queryset, but apparently there isn't:
{{{#!python
>>>
print(Child.objects.filter(parent_object__object_id__startswith='c').query)
SELECT "test_child"."id", "test_child"."parent_object_id" FROM
"test_child" WHERE "test_child"."parent_object_id" LIKE c% ESCAPE '\'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34015#comment:5>
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/01070183450c81fc-8c3a3062-5485-4390-bc4e-976cea946b9a-000000%40eu-central-1.amazonses.com.