Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 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?

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by hugo

  • Description modified (diff)

comment:2 Changed 8 years ago by hugo

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

comment:3 Changed 8 years ago by akaihola

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

comment:4 Changed 8 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 8 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')

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.