#1452 closed defect (fixed)
magic-removal: missing options from old query language
Reported by: | hugo | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | normal | 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 )
limit= and complex= are gone - but there is no doc on where they are gone. From the source I grok that limit= is gone to slicing, but since that's a bit different in behaviour (especially with selections where you could have less than your limit of rows - before it would just return the available rows or an empty set, now it will throw an error), this should be documented. And there is no notion on what to do with complex= query parameters, how to do those (this was done with queryset combinations, right? But there should be a sample in the docs).
If complex= is gone, shouldn't Q be removed from the source?
Change History (5)
comment:1 by , 19 years ago
Description: | modified (diff) |
---|
comment:2 by , 19 years ago
Component: | Admin interface → Documentation |
---|---|
Owner: | changed from | to
comment:3 by , 19 years ago
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The complex keyword goes away and you just use a collection of Q objects now. This is partially documented in docs/db-api.txt, although it has the wrong location for Q, but a full check of those docs is needed anyhow.
I have updated RemovingTheMagic to show how to replace complex=... constructs. As akaihola mentioned, slicing has now been fixed to emulate the previous behaviour of limit. So that resolves both issues from here.
comment:5 by , 19 years ago
Also, as an alternative to the 'Q' object method, you can do 'OR' queries by combining query objects directly, like this:
Reporter.objects.filter(name='Joe') | Reporter.objects.filter(name='Jane')
[2485] seems to fix the case with fewer rows than the limit in the selection.