def get_view_class(self, view_class, model=None, **opts):
    admin_class = (self.admin_site._registry.get(model) if model else None)
    return self.admin_site.get_view_class(view_class, admin_class, **opts)
def get_view_class(self, view_class, model=None, **opts):
    admin_class = (self.admin_site._registry.get(model) if model else None)
    return self.admin_site.get_view_class(view_class, admin_class, **opts)