def __init__(self, model):
        """
        Set model and modeladmin on which tool is acting
        for easy access in other methods.
        """
        from django.contrib.admin import site
        self.model = model
        self.modeladmin = site._registry.get(model)

        if self.modeladmin:
            self.modeladmin_changelist_view = self.modeladmin.changelist_view
            self.modeladmin.changelist_view = self.changelist_view
def __init__ ( self , model ) : from django . contrib . admin import site self . model = model self . modeladmin = site . _registry . get ( model ) if self . modeladmin : self . modeladmin_changelist_view = self . modeladmin . changelist_view self . modeladmin . changelist_view = self . changelist_view
Set model and modeladmin on which tool is acting
        for easy access in other methods.