def registered_modeladmin(model_cls):
    try:
        model_admin_cls = type(admin.site._registry[model_cls])
        model_admin_cls._model_cls = model_cls
        return model_admin_cls
    except __HOLE__:
        raise ImproperlyConfigured(
            "A ModelAdmin for %s needs to already be registered" % model_cls)
dataset/ETHPy150Open kux/django-admin-extend/admin_extend/extend.py/registered_modeladmin