mirror of
https://github.com/django/django.git
synced 2025-06-06 20:19:13 +00:00
magic-removal: Removed unnecessary legacy 'import copy' and restored some spacing that had been changed (for easier understanding of diffs)
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5bac096399
commit
83f8870489
@ -7,7 +7,6 @@ from django.db.models.query import handle_legacy_orderlist, orderlist2sql, order
|
|||||||
from django.dispatch import dispatcher
|
from django.dispatch import dispatcher
|
||||||
from django.db.models import signals
|
from django.db.models import signals
|
||||||
from django.utils.datastructures import SortedDict
|
from django.utils.datastructures import SortedDict
|
||||||
import copy
|
|
||||||
|
|
||||||
# Size of each "chunk" for get_iterator calls.
|
# Size of each "chunk" for get_iterator calls.
|
||||||
# Larger values are slightly faster at the expense of more storage space.
|
# Larger values are slightly faster at the expense of more storage space.
|
||||||
@ -19,7 +18,6 @@ def ensure_default_manager(sender):
|
|||||||
# Create the default manager, if needed.
|
# Create the default manager, if needed.
|
||||||
if hasattr(cls, 'objects'):
|
if hasattr(cls, 'objects'):
|
||||||
raise ValueError, "Model %s must specify a custom Manager, because it has a field named 'objects'" % name
|
raise ValueError, "Model %s must specify a custom Manager, because it has a field named 'objects'" % name
|
||||||
|
|
||||||
cls.add_to_class('objects', Manager())
|
cls.add_to_class('objects', Manager())
|
||||||
cls.objects._prepare()
|
cls.objects._prepare()
|
||||||
|
|
||||||
@ -369,5 +367,4 @@ class ManagerDescriptor(object):
|
|||||||
def __get__(self, instance, type=None):
|
def __get__(self, instance, type=None):
|
||||||
if instance != None:
|
if instance != None:
|
||||||
raise AttributeError, "Manager isn't accessible via %s instances" % type.__name__
|
raise AttributeError, "Manager isn't accessible via %s instances" % type.__name__
|
||||||
|
|
||||||
return self.manager
|
return self.manager
|
||||||
|
@ -108,7 +108,6 @@ class QuerySet(object):
|
|||||||
"""Sets the filters that should always be applied to queries"""
|
"""Sets the filters that should always be applied to queries"""
|
||||||
self._filter = Q(**kwargs)
|
self._filter = Q(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
def _clone(self, **kwargs):
|
def _clone(self, **kwargs):
|
||||||
"""Gets a clone of the object, with optional kwargs to alter the clone"""
|
"""Gets a clone of the object, with optional kwargs to alter the clone"""
|
||||||
# Don't clone (even temporarily) the cache
|
# Don't clone (even temporarily) the cache
|
||||||
@ -248,7 +247,6 @@ class QuerySet(object):
|
|||||||
else:
|
else:
|
||||||
return list(self.get_iterator())
|
return list(self.get_iterator())
|
||||||
|
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
"""Gets an iterator for the data"""
|
"""Gets an iterator for the data"""
|
||||||
# Fetch the data or use get_iterator? If not, we can't
|
# Fetch the data or use get_iterator? If not, we can't
|
||||||
@ -382,7 +380,6 @@ class Q:
|
|||||||
def get_sql(self, opts):
|
def get_sql(self, opts):
|
||||||
return parse_lookup(self.kwargs.items(), opts)
|
return parse_lookup(self.kwargs.items(), opts)
|
||||||
|
|
||||||
|
|
||||||
def get_where_clause(lookup_type, table_prefix, field_name, value):
|
def get_where_clause(lookup_type, table_prefix, field_name, value):
|
||||||
if table_prefix.endswith('.'):
|
if table_prefix.endswith('.'):
|
||||||
table_prefix = backend.quote_name(table_prefix[:-1])+'.'
|
table_prefix = backend.quote_name(table_prefix[:-1])+'.'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user