Opened 10 years ago

Closed 10 years ago

Last modified 10 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: UI/UX:

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 Changed 10 years ago by hugo

  • Description modified (diff)

comment:2 Changed 10 years ago by hugo

  • Component changed from Admin interface to Documentation
  • Owner changed from adrian to jacob

comment:3 Changed 10 years ago by akaihola

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

comment:4 Changed 10 years ago by Malcolm Tredinnick <malcolm@…>

  • Resolution set to fixed
  • Status changed from new to 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 Changed 10 years ago by lukeplant

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