(self, model, model_admin=None, **kwargs)
Registers the given model with the given admin class. Once a model is
        registered in self.registry, we also add it to app registries in
        self.apps.

        If no model_admin is passed, it will use ModelAdmin2. If keyword
        arguments are given they will be passed to the admin class on
        instantiation.

        If a model is already registered, this will raise ImproperlyConfigured.
Registers the given model with the given admin class. Once a model is
        registered in self.registry, we also add it to app registries in
        self.apps.
Registers the given model with the given admin class . Once a model is registered in self . registry we also add it to app registries in self . apps .
def register(self, model, model_admin=None, **kwargs):
        """
        Registers the given model with the given admin class. Once a model is
        registered in self.registry, we also add it to app registries in
        self.apps.

        If no model_admin is passed, it will use ModelAdmin2. If keyword
        arguments are given they will be passed to the admin class on
        instantiation.

        If a model is already registered, this will raise ImproperlyConfigured.
        """
        if model in self.registry:
            raise ImproperlyConfigured(
                "%s is already registered in django-admin2" % model
            )
        if not model_admin:
            model_admin = types.ModelAdmin2
        self.registry[model] = model_admin(model, admin=self, **kwargs)

        # Add the model to the apps registry
        app_label = utils.model_options(model).app_label
        if app_label in self.apps.keys():
            self.apps[app_label][model] = self.registry[model]
        else:
            self.apps[app_label] = {model: self.registry[model]}
def register ( self , model , model_admin = None , * * kwargs ) : if model in self . registry : raise ImproperlyConfigured ( "%s is already registered in django-admin2" % model ) if not model_admin : model_admin = types . ModelAdmin2 self . registry [ model ] = model_admin ( model , admin = self , * * kwargs ) # Add the model to the apps registry app_label = utils . model_options ( model ) . app_label if app_label in self . apps . keys ( ) : self . apps [ app_label ] [ model ] = self . registry [ model ] else : self . apps [ app_label ] = { model : self . registry [ model ] }