Django

Code

Changeset 7232

Show
Ignore:
Timestamp:
03/12/08 19:36:57 (4 months ago)
Author:
mtredinnick
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/queryset-refactor/django/db/models/query.py

    r7230 r7232  
    294294                _kind=kind, _order=order) 
    295295 
     296    def none(self): 
     297        """ 
     298        Returns an empty queryset. 
     299        """ 
     300        return self._clone(klass=EmptyQuerySet) 
     301 
    296302    ################################################################## 
    297303    # PUBLIC METHODS THAT ALTER ATTRIBUTES AND RETURN A NEW QUERYSET # 
  • django/branches/queryset-refactor/tests/modeltests/lookup/models.py

    r7163 r7232  
    255255>>> Article.objects.none().filter(headline__startswith='Article') 
    256256[] 
     257>>> Article.objects.filter(headline__startswith='Article').none() 
     258[] 
    257259>>> Article.objects.none().count() 
    2582600