summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-14 03:45:53 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-14 03:45:53 +0000
commitd219428b7cdea1e7b55e4508f85ba4daa32cb66d (patch)
treed35c332b95ceeadcf597ba0c13b165f5961d2df2 /django/db/models/sql
parentccc3a4766d1e4e8604db0925478ec351bc7f1e77 (diff)
queryset-refactor: Removed a whole bunch of unused code. This includes the
final remnants of handle_legacy_orderlist(). Refs #245. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py1
-rw-r--r--django/db/models/sql/utils.py27
2 files changed, 0 insertions, 28 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 194d0817cd..c5c7ee07ee 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -15,7 +15,6 @@ from django.db.models.sql.datastructures import Count, Date
from django.db.models.fields import FieldDoesNotExist, Field
from django.contrib.contenttypes import generic
from datastructures import EmptyResultSet
-from utils import handle_legacy_orderlist
try:
reversed
diff --git a/django/db/models/sql/utils.py b/django/db/models/sql/utils.py
deleted file mode 100644
index 6c6c32ab05..0000000000
--- a/django/db/models/sql/utils.py
+++ /dev/null
@@ -1,27 +0,0 @@
-"""
-Miscellaneous helper functions.
-"""
-
-import warnings
-
-from django.utils.encoding import smart_unicode
-
-# Django currently supports two forms of ordering.
-# Form 1 (deprecated) example:
-# order_by=(('pub_date', 'DESC'), ('headline', 'ASC'), (None, 'RANDOM'))
-# Form 2 (new-style) example:
-# order_by=('-pub_date', 'headline', '?')
-# Form 1 is deprecated and will no longer be supported for Django's first
-# official release. The following code converts from Form 1 to Form 2.
-
-LEGACY_ORDERING_MAPPING = {'ASC': '_', 'DESC': '-_', 'RANDOM': '?'}
-
-def handle_legacy_orderlist(order_list):
- if not order_list or isinstance(order_list[0], basestring):
- return order_list
- else:
- new_order_list = [LEGACY_ORDERING_MAPPING[j.upper()].replace('_', smart_unicode(i)) for i, j in order_list]
- warnings.warn("%r ordering syntax is deprecated. Use %r instead."
- % (order_list, new_order_list), DeprecationWarning)
- return new_order_list
-