1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +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:
Adrian Holovaty 2006-01-29 02:02:58 +00:00
parent 5bac096399
commit 83f8870489
2 changed files with 37 additions and 43 deletions

View File

@ -7,7 +7,6 @@ from django.db.models.query import handle_legacy_orderlist, orderlist2sql, order
from django.dispatch import dispatcher
from django.db.models import signals
from django.utils.datastructures import SortedDict
import copy
# Size of each "chunk" for get_iterator calls.
# 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.
if hasattr(cls, 'objects'):
raise ValueError, "Model %s must specify a custom Manager, because it has a field named 'objects'" % name
cls.add_to_class('objects', Manager())
cls.objects._prepare()
@ -369,5 +367,4 @@ class ManagerDescriptor(object):
def __get__(self, instance, type=None):
if instance != None:
raise AttributeError, "Manager isn't accessible via %s instances" % type.__name__
return self.manager

View File

@ -108,7 +108,6 @@ class QuerySet(object):
"""Sets the filters that should always be applied to queries"""
self._filter = Q(**kwargs)
def _clone(self, **kwargs):
"""Gets a clone of the object, with optional kwargs to alter the clone"""
# Don't clone (even temporarily) the cache
@ -248,7 +247,6 @@ class QuerySet(object):
else:
return list(self.get_iterator())
def __iter__(self):
"""Gets an iterator for the data"""
# Fetch the data or use get_iterator? If not, we can't
@ -382,7 +380,6 @@ class Q:
def get_sql(self, opts):
return parse_lookup(self.kwargs.items(), opts)
def get_where_clause(lookup_type, table_prefix, field_name, value):
if table_prefix.endswith('.'):
table_prefix = backend.quote_name(table_prefix[:-1])+'.'