mirror of
https://github.com/django/django.git
synced 2025-07-06 10:49:17 +00:00
queryset-refactor: Removed Options.get_order_sql(). It has no role to play any
longer. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d219428b7c
commit
91e8062ff5
@ -3,7 +3,6 @@ from django.db.models.related import RelatedObject
|
|||||||
from django.db.models.fields.related import ManyToManyRel
|
from django.db.models.fields.related import ManyToManyRel
|
||||||
from django.db.models.fields import AutoField, FieldDoesNotExist
|
from django.db.models.fields import AutoField, FieldDoesNotExist
|
||||||
from django.db.models.loading import get_models, app_cache_ready
|
from django.db.models.loading import get_models, app_cache_ready
|
||||||
from django.db.models.query import orderlist2sql
|
|
||||||
from django.db.models import Manager
|
from django.db.models import Manager
|
||||||
from django.utils.translation import activate, deactivate_all, get_language, string_concat
|
from django.utils.translation import activate, deactivate_all, get_language, string_concat
|
||||||
from django.utils.encoding import force_unicode, smart_str
|
from django.utils.encoding import force_unicode, smart_str
|
||||||
@ -130,12 +129,6 @@ class Options(object):
|
|||||||
return f
|
return f
|
||||||
raise FieldDoesNotExist, '%s has no field named %r' % (self.object_name, name)
|
raise FieldDoesNotExist, '%s has no field named %r' % (self.object_name, name)
|
||||||
|
|
||||||
def get_order_sql(self, table_prefix=''):
|
|
||||||
"Returns the full 'ORDER BY' clause for this object, according to self.ordering."
|
|
||||||
if not self.ordering: return ''
|
|
||||||
pre = table_prefix and (table_prefix + '.') or ''
|
|
||||||
return 'ORDER BY ' + orderlist2sql(self.ordering, self, pre)
|
|
||||||
|
|
||||||
def get_add_permission(self):
|
def get_add_permission(self):
|
||||||
return 'add_%s' % self.object_name.lower()
|
return 'add_%s' % self.object_name.lower()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user