1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +00:00

newforms-admin: Fixed #7702 -- Removed redundant imports in django/contrib/admin/options.py. Thanks, Honza

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2008-07-13 17:26:43 +00:00
parent 60c060c476
commit f3cda0b77a

View File

@ -257,7 +257,6 @@ class ModelAdmin(BaseModelAdmin):
# Check that LogEntry, ContentType and the auth context processor are installed. # Check that LogEntry, ContentType and the auth context processor are installed.
from django.conf import settings from django.conf import settings
if settings.DEBUG: if settings.DEBUG:
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.models import LogEntry from django.contrib.admin.models import LogEntry
if not LogEntry._meta.installed: if not LogEntry._meta.installed:
raise ImproperlyConfigured("Put 'django.contrib.admin' in your INSTALLED_APPS setting in order to use the admin application.") raise ImproperlyConfigured("Put 'django.contrib.admin' in your INSTALLED_APPS setting in order to use the admin application.")
@ -360,7 +359,6 @@ class ModelAdmin(BaseModelAdmin):
`form` is a bound Form instance that's verified to be valid. `form` is a bound Form instance that's verified to be valid.
""" """
from django.contrib.admin.models import LogEntry, ADDITION from django.contrib.admin.models import LogEntry, ADDITION
from django.contrib.contenttypes.models import ContentType
opts = model._meta opts = model._meta
new_object = form.save(commit=True) new_object = form.save(commit=True)
@ -410,7 +408,6 @@ class ModelAdmin(BaseModelAdmin):
`formsets` is a sequence of InlineFormSet instances that are verified to be valid. `formsets` is a sequence of InlineFormSet instances that are verified to be valid.
""" """
from django.contrib.admin.models import LogEntry, CHANGE from django.contrib.admin.models import LogEntry, CHANGE
from django.contrib.contenttypes.models import ContentType
opts = model._meta opts = model._meta
new_object = form.save(commit=True) new_object = form.save(commit=True)
pk_value = new_object._get_pk_val() pk_value = new_object._get_pk_val()
@ -659,7 +656,6 @@ class ModelAdmin(BaseModelAdmin):
def delete_view(self, request, object_id, extra_context=None): def delete_view(self, request, object_id, extra_context=None):
"The 'delete' admin view for this model." "The 'delete' admin view for this model."
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.models import LogEntry, DELETION from django.contrib.admin.models import LogEntry, DELETION
opts = self.model._meta opts = self.model._meta
app_label = opts.app_label app_label = opts.app_label
@ -713,7 +709,6 @@ class ModelAdmin(BaseModelAdmin):
def history_view(self, request, object_id, extra_context=None): def history_view(self, request, object_id, extra_context=None):
"The 'history' admin view for this model." "The 'history' admin view for this model."
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.models import LogEntry from django.contrib.admin.models import LogEntry
model = self.model model = self.model
opts = model._meta opts = model._meta