PageQuerySet.specific docs should mention filtering/ordering restrictions
See original GitHub issueAs suggested at https://stackoverflow.com/a/55532616/1853523, the docs for PageQuerySet.specific
should:
- go into more detail about the sequence of queries that happens internally
- explain that adding
specific()
to a queryset expression does not make fields from the specific page available for use withinfilter
/order_by
clauses - mention that if your query is targetting one Page subclass in particular, you can work around this by reorganising your query to not require
specific
, e.g.article_index_page.get_children().specific()
becomesArticlePage.objects.child_of(article_index_page)
- possibly also mention that the above workaround won’t help you if you have multiple page types with same-named fields on them (because they aren’t actually the same field from the database’s point of view).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (4 by maintainers)
Top Results From Across the Web
QuerySet API reference | Django documentation
Internally, a QuerySet can be constructed, filtered, sliced, and generally passed around without actually hitting the database. No database activity actually ...
Read more >Filtering - Django REST framework
Often you will want your API to restrict the items that are returned by the queryset. The simplest way to filter the queryset...
Read more >Django: Ordering a QuerySet based on a latest child models ...
The Django QuerySet documentation states: It is permissible to specify a multi-valued field to order the results by (for example, a ManyToManyField field)....
Read more >Filtering QuerySets dynamically in Django - LogRocket Blog
Learn how to filter a Django QuerySet dynamically using AJAX, and build list pages for your web apps that allow filtering and pagination....
Read more >QuerySet API reference — Django 1.5.12 documentation
Note : Don't use len() on QuerySet s if all you want to do is determine the number of records ... ...since the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brylie Assuming
field_on_model
is a field defined on theContact
model, thenContact.objects.child_of(self).filter(field_on_model="something")
(without thespecific()
) should work.Thanks for the quick response! It works! Will be glad to see this in the docs, as I have been spending nearly one hour trying to figure this out by guesswork 😃