From c8c7f071906a49d7b3e2be61b1d06e8adaa7bda7 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 23 Jan 2006 04:35:02 +0000 Subject: [PATCH] magic-removal: Removed 'admin', 'exceptions' and 'module_constants' parameters to 'class Meta' git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2114 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/models.py | 4 +++- django/contrib/sessions/models.py | 7 ------- django/db/models/options.py | 6 ++---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 87a0c49846..7793b535eb 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -6,6 +6,9 @@ import datetime SESSION_KEY = '_auth_user_id' +class SiteProfileNotAvailable(Exception): + pass + class Permission(models.Model): name = models.CharField(_('name'), maxlength=50) package = models.ForeignKey(Package, db_column='package') @@ -67,7 +70,6 @@ class User(models.Model): verbose_name = _('User') verbose_name_plural = _('Users') ordering = ('username',) - exceptions = ('SiteProfileNotAvailable',) class Admin: fields = ( (None, {'fields': ('username', 'password')}), diff --git a/django/contrib/sessions/models.py b/django/contrib/sessions/models.py index 1d4a148dad..13742f11a4 100644 --- a/django/contrib/sessions/models.py +++ b/django/contrib/sessions/models.py @@ -40,13 +40,6 @@ class Session(models.Model): db_table = 'django_session' verbose_name = _('session') verbose_name_plural = _('sessions') - module_constants = { - 'base64': base64, - 'md5': md5, - 'pickle': pickle, - 'random': random, - 'sys': sys, - } def get_decoded(self): encoded_data = base64.decodestring(self.session_data) diff --git a/django/db/models/options.py b/django/db/models/options.py index 7a6edacab9..315811a0f1 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -10,8 +10,8 @@ import re get_verbose_name = lambda class_name: re.sub('([A-Z])', ' \\1', class_name).lower().strip() DEFAULT_NAMES = ('verbose_name', 'verbose_name_plural', 'db_table', 'ordering', - 'unique_together', 'admin', 'where_constraints', 'exceptions', 'permissions', - 'get_latest_by', 'order_with_respect_to', 'module_constants') + 'unique_together', 'where_constraints', 'permissions', + 'get_latest_by', 'order_with_respect_to') class Options: def __init__(self, meta): @@ -22,12 +22,10 @@ class Options: self.ordering = [] self.unique_together = [] self.where_constraints = [] - self.exceptions = [] self.permissions = [] self.object_name, self.app_label = None, None self.get_latest_by = None self.order_with_respect_to = None - self.module_constants = {} self.admin = None self.meta = meta self.pk = None