Changeset 6600
- Timestamp:
- 10/23/07 08:49:07 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/queryset-refactor/django/db/models/query.py
r6599 r6600 246 246 # PUBLIC METHODS THAT ALTER ATTRIBUTES AND RETURN A NEW QUERYSET # 247 247 ################################################################## 248 249 def all(self): 250 """ 251 Returns a new QuerySet that is a copy of the current one. This allows a 252 QuerySet to proxy for a model manager in some cases. 253 """ 254 return self._clone() 248 255 249 256 def filter(self, *args, **kwargs): django/branches/queryset-refactor/docs/db-api.txt
r6520 r6600 682 682 [] 683 683 684 ``all()`` 685 ~~~~~~~~~~ 686 687 **New in Django development version** 688 689 Returns a ''copy'' of the current ``QuerySet`` (or ``QuerySet`` subclass you 690 pass in). This can be useful in some situations where you might want to pass 691 in either a model manager or a ``QuerySet`` and do further filtering on the 692 result. You can safely call ``all()`` on either object and then you'll 693 definitely have a ``QuerySet`` to work with. 694 684 695 ``select_related()`` 685 696 ~~~~~~~~~~~~~~~~~~~~ django/branches/queryset-refactor/tests/regressiontests/queries/models.py
r6521 r6600 375 375 [] 376 376 377 Bug #3739 378 The all() method on querysets returns a copy of the queryset. 379 >>> q1 = Item.objects.order_by('name') 380 >>> id(q1) == id(q1.all()) 381 False 377 382 """} 378 383
