Django

Code

Ticket #7260 (closed: fixed)

Opened 5 months ago

Last modified 4 months ago

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

Reported by: leotr Assigned to: leotr
Milestone: Component: Documentation
Version: SVN Keywords: db-api
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

db-api.diff (0.7 kB) - added by leotr on 05/19/08 02:59:51.

Change History

05/19/08 02:06:21 changed by leotr

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

05/19/08 02:59:51 changed by leotr

  • attachment db-api.diff added.

05/19/08 03:19:06 changed by leotr

  • owner changed from nobody to leotr.
  • status changed from new to assigned.
  • stage changed from Design decision needed to Accepted.

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

05/26/08 22:42:53 changed by leotr

  • stage changed from Accepted to Ready for checkin.

05/29/08 06:56:32 changed by russellm

  • status changed from assigned to closed.
  • resolution set to fixed.

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


Add/Change #7260 (fixed db-api documentation on queryset.get() method)




Change Properties
Action