Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#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 hugo)

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 hugo, 18 years ago

Description: modified (diff)

comment:2 by hugo, 18 years ago

Component: Admin interfaceDocumentation
Owner: changed from Adrian Holovaty to Jacob

comment:3 by Antti Kaihola, 18 years ago

[2485] seems to fix the case with fewer rows than the limit in the selection.

comment:4 by Malcolm Tredinnick <malcolm@…>, 18 years ago

Resolution: fixed
Status: newclosed

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 Luke Plant, 18 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')
Note: See TracTickets for help on using tickets.
Back to Top