summaryrefslogtreecommitdiff
path: root/django/db/models/query.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-01 04:12:30 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-01 04:12:30 +0000
commit3242df16e4e53afc58657cd7e01d0ba807e96288 (patch)
tree39da1004cdf06f4f1258a6a6825f7294fdb41e01 /django/db/models/query.py
parentc6a404d1e977cae75345594bf264ca103e1a1d33 (diff)
To avoid an unfortunately common user-error, rename QuerySet.as_sql().
This was never a public API method, so this is backwards compatible, unless you're poking at the internals. Refs #10352. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9928 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/query.py')
-rw-r--r--django/db/models/query.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index f9b5577891..1699991937 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -703,12 +703,9 @@ class QuerySet(object):
self.query.add_fields(field_names, False)
self.query.set_group_by()
- def as_sql(self):
+ def _as_sql(self):
"""
Returns the internal query's SQL and parameters (as a tuple).
-
- This is a private (internal) method. The name is chosen to provide
- uniformity with other interfaces (in particular, the Query class).
"""
obj = self.values("pk")
return obj.query.as_nested_sql()
@@ -812,7 +809,7 @@ class ValuesQuerySet(QuerySet):
super(ValuesQuerySet, self)._setup_aggregate_query(aggregates)
- def as_sql(self):
+ def _as_sql(self):
"""
For ValueQuerySet (and subclasses like ValuesListQuerySet), they can
only be used as nested queries if they're already set up to select only