Remove AppCache state handling, replace with swappable caches

This commit is contained in:
Andrew Godwin 2012-09-22 00:47:04 +01:00
parent dbc17d035b
commit 49d1e6b0e2
6 changed files with 72 additions and 83 deletions

View file

@ -21,7 +21,7 @@ get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|
DEFAULT_NAMES = ('verbose_name', 'verbose_name_plural', 'db_table', 'ordering',
'unique_together', 'permissions', 'get_latest_by',
'order_with_respect_to', 'app_label', 'db_tablespace',
'abstract', 'managed', 'proxy', 'auto_created')
'abstract', 'managed', 'proxy', 'auto_created', 'auto_register')
@python_2_unicode_compatible
class Options(object):
@ -68,6 +68,9 @@ class Options(object):
# from *other* models. Needed for some admin checks. Internal use only.
self.related_fkey_lookups = []
# If we should auto-register with the AppCache
self.auto_register = True
def contribute_to_class(self, cls, name):
from django.db import connection
from django.db.backends.util import truncate_name