From ec469ade2b04b94bfeb59fb0fc7d9300470be615 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Tue, 5 Feb 2013 04:16:07 -0500 Subject: Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. --- django/core/cache/backends/db.py | 2 +- django/core/management/sql.py | 4 ++-- django/core/serializers/python.py | 2 +- django/core/xheaders.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'django/core') diff --git a/django/core/cache/backends/db.py b/django/core/cache/backends/db.py index c93bc90b18..5c9ea3e7bb 100644 --- a/django/core/cache/backends/db.py +++ b/django/core/cache/backends/db.py @@ -23,7 +23,7 @@ class Options(object): def __init__(self, table): self.db_table = table self.app_label = 'django_cache' - self.module_name = 'cacheentry' + self.model_name = 'cacheentry' self.verbose_name = 'cache entry' self.verbose_name_plural = 'cache entries' self.object_name = 'CacheEntry' diff --git a/django/core/management/sql.py b/django/core/management/sql.py index e46f4ae4f5..66df43e971 100644 --- a/django/core/management/sql.py +++ b/django/core/management/sql.py @@ -173,8 +173,8 @@ def custom_sql_for_model(model, style, connection): # Find custom SQL, if it's available. backend_name = connection.settings_dict['ENGINE'].split('.')[-1] - sql_files = [os.path.join(app_dir, "%s.%s.sql" % (opts.object_name.lower(), backend_name)), - os.path.join(app_dir, "%s.sql" % opts.object_name.lower())] + sql_files = [os.path.join(app_dir, "%s.%s.sql" % (opts.model_name, backend_name)), + os.path.join(app_dir, "%s.sql" % opts.model_name)] for sql_file in sql_files: if os.path.exists(sql_file): with codecs.open(sql_file, 'U', encoding=settings.FILE_CHARSET) as fp: diff --git a/django/core/serializers/python.py b/django/core/serializers/python.py index 37fa906280..5e07e2a006 100644 --- a/django/core/serializers/python.py +++ b/django/core/serializers/python.py @@ -143,7 +143,7 @@ def Deserializer(object_list, **options): def _get_model(model_identifier): """ - Helper to look up a model from an "app_label.module_name" string. + Helper to look up a model from an "app_label.model_name" string. """ try: Model = models.get_model(*model_identifier.split(".")) diff --git a/django/core/xheaders.py b/django/core/xheaders.py index b650a3a6d4..3766628c98 100644 --- a/django/core/xheaders.py +++ b/django/core/xheaders.py @@ -20,5 +20,5 @@ def populate_xheaders(request, response, model, object_id): if (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (hasattr(request, 'user') and request.user.is_active and request.user.is_staff)): - response['X-Object-Type'] = "%s.%s" % (model._meta.app_label, model._meta.object_name.lower()) + response['X-Object-Type'] = "%s.%s" % (model._meta.app_label, model._meta.model_name) response['X-Object-Id'] = str(object_id) -- cgit v1.3