Skip to content

Commit

Permalink
Added support for django-reversion to ForeignkeyAutocompleteAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Mayfield authored and trbs committed Jan 6, 2010
1 parent a68c4cd commit e401f82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions django_extensions/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
import operator
from django.http import HttpResponse, HttpResponseNotFound
from django.contrib import admin
from django.db import models
from django.db.models.query import QuerySet
from django.utils.encoding import smart_str
Expand All @@ -20,7 +19,13 @@

from django_extensions.admin.widgets import ForeignKeySearchInput

class ForeignKeyAutocompleteAdmin(admin.ModelAdmin):
from django.conf import settings
if 'reversion' in settings.INSTALLED_APPS:
from reversion.admin import VersionAdmin as ModelAdmin
else:
from django.contrib.admin import ModelAdmin

class ForeignKeyAutocompleteAdmin(ModelAdmin):
"""Admin class for models using the autocomplete feature.
There are two additional fields:
Expand Down

0 comments on commit e401f82

Please sign in to comment.