Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed a bug in r11646 - refs #11402

The one line of code not covered by a test... ;-)


git-svn-id: http://code.djangoproject.com/svn/django/trunk@11647 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2b2f92ae8ebd47978c132c403d8c6b617f497fb4 1 parent b79702b
Luke Plant authored October 24, 2009
2  django/db/models/manager.py
@@ -173,7 +173,7 @@ def only(self, *args, **kwargs):
173 173
         return self.get_query_set().only(*args, **kwargs)
174 174
 
175 175
     def exists(self, *args, **kwargs):
176  
-        return self.get_query_ste().exists(*args, **kwargs)
  176
+        return self.get_query_set().exists(*args, **kwargs)
177 177
 
178 178
     def _insert(self, values, **kwargs):
179 179
         return insert_query(self.model, values, **kwargs)
8  tests/modeltests/lookup/models.py
@@ -17,6 +17,10 @@ def __unicode__(self):
17 17
         return self.headline
18 18
 
19 19
 __test__ = {'API_TESTS': r"""
  20
+# We can use .exists() to check that there are none yet
  21
+>>> Article.objects.exists()
  22
+False
  23
+
20 24
 # Create a couple of Articles.
21 25
 >>> from datetime import datetime
22 26
 >>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
@@ -33,6 +37,10 @@ def __unicode__(self):
33 37
 >>> a6.save()
34 38
 >>> a7 = Article(headline='Article 7', pub_date=datetime(2005, 7, 27))
35 39
 >>> a7.save()
  40
+
  41
+# There should be some now!
  42
+>>> Article.objects.exists()
  43
+True
36 44
 """}
37 45
 
38 46
 if settings.DATABASE_ENGINE in ('postgresql', 'postgresql_pysycopg2'):

0 notes on commit 2b2f92a

Please sign in to comment.
Something went wrong with that request. Please try again.