Opened 6 years ago

Closed 6 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: master
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


I see that "Complex lookups with Q objects" from
is using objects.get as example to retrieve multiple objects, but this raise a MultipleObjectsReturned exception.

Change History (1)

comment:1 Changed 6 years ago by Simon Charette

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