- Timestamp:
- 07/15/08 16:43:21 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin/django/contrib/admin/sites.py
r7825 r7929 8 8 from django.utils.translation import ugettext_lazy, ugettext as _ 9 9 from django.views.decorators.cache import never_cache 10 from django.conf import settings 10 11 import base64 11 12 import cPickle as pickle … … 66 67 If a model is already registered, this will raise AlreadyRegistered. 67 68 """ 69 do_validate = admin_class and settings.DEBUG 70 if do_validate: 71 # don't import the humongous validation code unless required 72 from django.contrib.admin.validation import validate 68 73 admin_class = admin_class or ModelAdmin 69 74 # TODO: Handle options … … 73 78 if model in self._registry: 74 79 raise AlreadyRegistered('The model %s is already registered' % model.__name__) 80 if do_validate: 81 validate(admin_class, model) 75 82 self._registry[model] = admin_class(model, self) 76 83
