1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

magic-removal: Renamed 'class META' to 'class Meta' in models

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1754 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-12-21 02:42:27 +00:00
parent fe524625ed
commit 29fe9598e0
22 changed files with 48 additions and 48 deletions

View File

@@ -30,7 +30,7 @@ class ModelBase(type):
# Create the class.
new_class = type.__new__(cls, name, bases, {'__module__': attrs.pop('__module__')})
new_class.add_to_class('_meta', Options(attrs.pop('META', None)))
new_class.add_to_class('_meta', Options(attrs.pop('Meta', None)))
new_class.add_to_class('DoesNotExist', types.ClassType('DoesNotExist', (ObjectDoesNotExist,), {}))
#Figure out the app_label by looking one level up.

View File

@@ -33,7 +33,7 @@ class Options:
self.order_with_respect_to = None
self.module_constants = {}
self.admin = None
self.meta = meta
self.pk = None
self.has_auto_field = False
@@ -46,7 +46,7 @@ class Options:
for attr_name in DEFAULT_NAMES:
setattr(self, attr_name, meta_attrs.pop(attr_name, getattr(self, attr_name)))
if meta_attrs != {}:
raise TypeError, "'class META' got invalid attribute(s): %s" % ','.join(meta_attrs.keys())
raise TypeError, "'class Meta' got invalid attribute(s): %s" % ','.join(meta_attrs.keys())
def contribute_to_class(self, cls, name):
cls._meta = self