Django

Code

Ticket #6177 (closed: fixed)

Opened 5 months ago

Last modified 3 weeks ago

Only managers have a none() method (not Querysets)

Reported by: gwilson Assigned to: nobody
Component: Database wrapper Version: SVN
Keywords: qs-rf-fixed Cc:
Triage Stage: Fixed on a branch Has patch: 0
Needs documentation: 0 Needs tests: 0
Patch needs improvement: 0

Description

For compatibility with QuerySet.

>>> User.objects.all().values().none()
Traceback (most recent call last):
  File "<console>", line 1, in ?
AttributeError: 'ValuesQuerySet' object has no attribute 'none'

Attachments

Change History

03/12/08 11:00:25 changed by guettli

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

03/12/08 19:06:16 changed by mtredinnick

  • stage changed from Accepted to Design decision needed.

Querysets don't have a none() method. Only managers do.

Why is this needed on Querysets ("consistency" isn't an answer, since it's already consistent.. what's the actual use-case)?

03/12/08 19:10:43 changed by mtredinnick

  • summary changed from ValuesQuerySet should have a none() method to Only managers have a none() method (not Querysets).
  • stage changed from Design decision needed to Accepted.

So it looks like this is some massive oversight in [4934], since it's documented as being intended to be a queryset method. Changing the title to reflect the real problem report. It's pretty easy to fix on qs-rf.

03/12/08 19:36:58 changed by mtredinnick

(In [7232]) queryset-refactor: Made none() a method on Querysets, as the documentation indicates (it was only added to managers in [4394]. Refs #6177.

03/12/08 19:37:46 changed by mtredinnick

  • keywords set to qs-rf-fixed.
  • stage changed from Accepted to Fixed on a branch.

04/26/08 21:50:16 changed by mtredinnick

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

(In [7477]) Merged the queryset-refactor branch into trunk.

This is a big internal change, but mostly backwards compatible with existing code. Also adds a couple of new features.

Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658


Add/Change #6177 (Only managers have a none() method (not Querysets))




Change Properties
Action