mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +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:
parent
aaf8760227
commit
c44fb66551
10 changed files with 21 additions and 25 deletions
|
@ -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:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue