def patch_admin(model, admin_site=None):
 admin_site = (admin_site or admin.site)
 try:
  ModelAdmin = admin_site._registry[model].__class__
 except KeyError:
  raise NotRegistered, ('The model %r has not been registered with the admin site.' % model)
 admin_site.unregister(model)
 class PatchedModelAdmin(VersionAdmin, ModelAdmin, ):
  pass
 admin_site.register(model, PatchedModelAdmin)

def patch_admin ( model , admin_site = None ) : admin_site = ( admin_site or admin . site ) try : ModelAdmin = admin_site . _registry [ model ] . __class__ except KeyError : raise NotRegistered , ( 'The model %r has not been registered with the admin site.' % model ) admin_site . unregister ( model ) class PatchedModelAdmin ( VersionAdmin , ModelAdmin , ) : pass admin_site . register ( model , PatchedModelAdmin )
enables version control with full admin integration for a model that has already been registered with the django admin site .