Author: mtredinnick
Date: 2007-10-13 22:45:53 -0500 (Sat, 13 Oct 2007)
New Revision: 6501

Removed:
   django/branches/queryset-refactor/django/db/models/sql/utils.py
Modified:
   django/branches/queryset-refactor/django/db/models/query.py
   django/branches/queryset-refactor/django/db/models/sql/query.py
Log:
queryset-refactor: Removed a whole bunch of unused code. This includes the
final remnants of handle_legacy_orderlist(). Refs #245.


Modified: django/branches/queryset-refactor/django/db/models/query.py
===================================================================
--- django/branches/queryset-refactor/django/db/models/query.py 2007-10-14 
03:45:34 UTC (rev 6500)
+++ django/branches/queryset-refactor/django/db/models/query.py 2007-10-14 
03:45:53 UTC (rev 6501)
@@ -22,33 +22,6 @@
 # when deleting objects).
 CHUNK_SIZE = 100
 
-####################
-# HELPER FUNCTIONS #
-####################
-
-# FIXME
-def orderlist2sql(order_list, opts, prefix=''):
-    raise NotImplementedError
-##def orderlist2sql(order_list, opts, prefix=''):
-##    qn = connection.ops.quote_name
-##    if prefix.endswith('.'):
-##        prefix = qn(prefix[:-1]) + '.'
-##    output = []
-##    for f in handle_legacy_orderlist(order_list):
-##        if f.startswith('-'):
-##            output.append('%s%s DESC' % (prefix, qn(orderfield2column(f[1:], 
opts))))
-##        elif f == '?':
-##            output.append(connection.ops.random_function_sql())
-##        else:
-##            output.append('%s%s ASC' % (prefix, qn(orderfield2column(f, 
opts))))
-##    return ', '.join(output)
-
-##def quote_only_if_word(word):
-##    if re.search('\W', word): # Don't quote if there are spaces or non-word 
chars.
-##        return word
-##    else:
-##        return connection.ops.quote_name(word)
-
 class _QuerySet(object):
     "Represents a lazy database lookup for a set of objects"
     def __init__(self, model=None):

Modified: django/branches/queryset-refactor/django/db/models/sql/query.py
===================================================================
--- django/branches/queryset-refactor/django/db/models/sql/query.py     
2007-10-14 03:45:34 UTC (rev 6500)
+++ django/branches/queryset-refactor/django/db/models/sql/query.py     
2007-10-14 03:45:53 UTC (rev 6501)
@@ -15,7 +15,6 @@
 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

Deleted: django/branches/queryset-refactor/django/db/models/sql/utils.py
===================================================================
--- django/branches/queryset-refactor/django/db/models/sql/utils.py     
2007-10-14 03:45:34 UTC (rev 6500)
+++ django/branches/queryset-refactor/django/db/models/sql/utils.py     
2007-10-14 03:45:53 UTC (rev 6501)
@@ -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
-


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to