Opened 17 years ago

Closed 17 years ago

#7260 closed (fixed)

fixed db-api documentation on queryset.get() method

Reported by: leotr Owned by: leotr
Component: Documentation Version: dev
Severity: Keywords: db-api
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

According to documentation:

get() raises AssertionError if more than one object was found

According to the Queryset.get():

        if num == 1:
            return clone._result_cache[0]
        if not num:
            raise self.model.DoesNotExist("%s matching query does not exist."
                    % self.model._meta.object_name)
        raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"

Seems like documentation is wrong.

Attachments (1)

db-api.diff (718 bytes ) - added by leotr 17 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by leotr, 17 years ago

Triage Stage: UnreviewedDesign decision needed

by leotr, 17 years ago

Attachment: db-api.diff added

comment:2 by leotr, 17 years ago

Owner: changed from nobody to leotr
Status: newassigned
Triage Stage: Design decision neededAccepted

Actually it's a bug, so i think that it should be checked in without decision of core team

comment:3 by leotr, 17 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Russell Keith-Magee, 17 years ago

Resolution: fixed
Status: assignedclosed

(In [7559]) Fixed #7260 -- Corrected the description of the exception returned by get() when multiple objects match the search criteria. Thanks, leotr.

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