mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Refactored get_random_function_sql() to DatabaseOperations.random_function_sql(). Refs #5106
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5962 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -71,7 +71,7 @@ def orderlist2sql(order_list, opts, prefix=''):
|
||||
if f.startswith('-'):
|
||||
output.append('%s%s DESC' % (prefix, backend.quote_name(orderfield2column(f[1:], opts))))
|
||||
elif f == '?':
|
||||
output.append(backend.get_random_function_sql())
|
||||
output.append(connection.ops.random_function_sql())
|
||||
else:
|
||||
output.append('%s%s ASC' % (prefix, backend.quote_name(orderfield2column(f, opts))))
|
||||
return ', '.join(output)
|
||||
@@ -531,7 +531,7 @@ class _QuerySet(object):
|
||||
ordering_to_use = opts.ordering
|
||||
for f in handle_legacy_orderlist(ordering_to_use):
|
||||
if f == '?': # Special case.
|
||||
order_by.append(backend.get_random_function_sql())
|
||||
order_by.append(connection.ops.random_function_sql())
|
||||
else:
|
||||
if f.startswith('-'):
|
||||
col_name = f[1:]
|
||||
|
||||
Reference in New Issue
Block a user