Opened 12 years ago

Closed 12 years ago

#19961 closed Bug (invalid)

Examples of "Complex lookups with Q objects" using objects.get

Reported by: ec.dani@… Owned by: nobody
Component: Documentation Version: dev
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

I see that "Complex lookups with Q objects" from
https://docs.djangoproject.com/en/1.4/topics/db/queries/
is using objects.get as example to retrieve multiple objects, but this raise a MultipleObjectsReturned exception.

Change History (1)

comment:1 by Simon Charette, 12 years ago

Resolution: invalid
Status: newclosed
Version: 1.4master

As stated in the Complex lookups with Q objects:

Each lookup function that takes keyword-arguments (e.g. filter(), exclude(), get()) can also be passed one or more Q objects as positional (not-named) arguments.

The examples only use get but I can't find that retrieve multiple objects reference, you can use complex lookups to retrieve a single object.

Note: See TracTickets for help on using tickets.
Back to Top