Opened 15 years ago
Last modified 15 years ago
#11719 closed
Lookups that span relationships: Typo? — at Version 1
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I was reading here: http://docs.djangoproject.com/en/dev/topics/db/queries/#lookups-that-span-relationships
...and specifically this section:
This example retrieves all Entry objects with a Blog whose name is 'Beatles Blog': >>> Entry.objects.filter(blog__name__exact='Beatles Blog') This spanning can be as deep as you'd like. It works backwards, too. To refer to a "reverse" relationship, just use the lowercase name of the model. This example retrieves all Blog objects which have at least one Entry whose headline contains 'Lennon': >>> Blog.objects.filter(entry__headline__contains='Lennon')
First, maybe I'm tired, but I don't see any difference in how the models in those two examples are different with respect to capitalization.
Second, the way it's written: "just use the lowercase name of the model" makes figuring out which example is correct and which might contain a typo ambiguous. That sentence should read something like "just use the lowercase name of the model in the argument to filter()". I do assume that that's what you're talking about, because the objects whose methods are being called are using Python lookups, no?
So, not a huge deal, it's a documentation bug (I think), but it could stump some newbies.