Alias to register model
    :param kwargs:
    :return:
492459
def register_models(**kwargs):
    
    [setattr(models, k, v) for k, v in kwargs.items()]
1370870
def register_model(self, app, model_name, field_type, field_definitions):
        
        from django.apps import apps
        import collections

        app_label = app

        if isinstance(field_definitions, str):
            field_definitions = [field_definitions]
        elif not isinstance(field_definitions, collections.Iterable):
            raise ImproperlyConfigured(_('Field configuration for %(app)s should be a string or iterable') % {'app': app})

        if field_type not in ('ForeignKey', 'ManyToManyField'):
            raise ImproperlyConfigured(_('`field_type` must be either `"ForeignKey"` or `"ManyToManyField"`.'))

        try:
            if not hasattr(model_name, "_meta"):
                app_config = apps.get_app_config(app)
                app_label = app_config.label
                model = app_config.get_model(model_name)
            else:
                model = model_name
                model_name = model._meta.model_name
            opts = model._meta
            if app_label not in self._model_registry:
                self._model_registry[app_label] = []
            if model not in self._model_registry[app_label]:
                self._model_registry[app_label].append(model)
        except LookupError:
            raise ImproperlyConfigured('Model "%(model)s" doesn\'t exist in app "%(app)s".' % {'model': model_name, 'app': app})

        if not isinstance(field_definitions, (tuple, list)):
            field_definitions = [field_definitions]

        for fld in field_definitions:
            extra_params = {'to': 'categories.Category', 'blank': True}
            if field_type != 'ManyToManyField':
                extra_params['on_delete'] = CASCADE
                extra_params['null'] = True
            if isinstance(fld, str):
                field_name = fld
            elif isinstance(fld, dict):
                if 'name' in fld:
                    field_name = fld.pop('name')
                else:
                    continue
                extra_params.update(fld)
            else:
                raise ImproperlyConfigured(
                    _("%(settings)s doesn't recognize the value of %(app)s.%(model)s") % {
                        'settings': 'CATEGORY_SETTINGS',
                        'app': app,
                        'model': model_name})
            registry_name = ".".join([app_label, model_name.lower(), field_name])
            if registry_name in self._field_registry:
                continue

            try:
                opts.get_field(field_name)
            except FieldDoesNotExist:
                self._field_registry[registry_name] = FIELD_TYPES[field_type](**extra_params)
                self._field_registry[registry_name].contribute_to_class(model, field_name)
544770
def register(self, ModelClass, form_field=None, widget=None, title=None, prefix=None, has_id_value=True):
        
        if any(urltype.model == ModelClass for urltype in self._url_types):
            raise ValueError("Model is already registered: '{0}'".format(ModelClass))

        opts = ModelClass._meta
        opts = opts.concrete_model._meta

        if not prefix:
            # Store something descriptive, easier to lookup from raw database content.
            prefix = '{0}.{1}'.format(opts.app_label, opts.object_name.lower())
        if not title:
            title = ModelClass._meta.verbose_name

        if self.is_external_url_prefix(prefix):
            raise ValueError("Invalid prefix value: '{0}'.".format(prefix))
        if self[prefix] is not None:
            raise ValueError("Prefix is already registered: '{0}'".format(prefix))
        if form_field is not None and widget is not None:
            raise ValueError("Provide either a form_field or widget; use the widget parameter of the form field instead.")

        urltype = UrlType(ModelClass, form_field, widget, title, prefix, has_id_value)
        signals.post_save.connect(_on_model_save, sender=ModelClass)
        self._url_types.append(urltype)
        return urltype
422378
def register(self, klass, callback, name="default"):
        
        if klass not in self._definitions:
            self._definitions[klass] = {}

        self._definitions[klass][name] = callback
728380
def model_alias(vk, model):
    """"""
    model['alias'] = {}

    # types
    for s in vk['registry']['types']['type']:
        if s.get('@category', None) == 'handle' and s.get('@alias'):
            model['alias'][s['@alias']] = s['@name'] 
              
    # commands
    for c in vk['registry']['commands']['command']:
        if c.get('@alias'):
            model['alias'][c['@alias']] = c['@name']
700593
def register(matcher, *aliases):
    
    docstr = matcher.__doc__ if matcher.__doc__ is not None else ''
    helpmatchers[matcher] = docstr.strip()

    for alias in aliases:
        matchers[alias] = matcher
        # Map a normalized version of the alias
        norm = normalize(alias)
        normalized[norm] = alias
        # Map a version without snake case
        norm = norm.replace('_', '')
        normalized[norm] = alias
498917
def register(model, admin=None, category=None):
    
    def _model_admin_wrapper(admin_class):

        site.register(model, admin_class=admin_class)

        if category:
            site.register_block(model, category)

        return admin_class
    return _model_admin_wrapper
241613
def alias_action(self, *args, **kwargs):
        
        to = kwargs.pop('to', None)
        if not to:
            return
        error_message = ("You can't specify target ({}) as alias "
                         "because it is real action name".format(to)
                         )
        if to in list(itertools.chain(*self.aliased_actions.values())):
            raise Exception(error_message)

        self.aliased_actions.setdefault(to, []).extend(args)
605625
def mk_kwargs(cls, kwargs):
        
        ret = {}
        kws = ['row_factory', 'body', 'parent']
        for k in kws:
            if k in kwargs:
                ret[k] = kwargs.pop(k)

        return ret
555207
def add_aliases(self_or_cls, **kwargs):
        
        self_or_cls.aliases.update({v:k for k,v in kwargs.items()})
576864
def register(cls, instance_class, name=None):
        
        if name is None:
            name = instance_class.__name__
        cls.INSTANCE_CLASSES[name] = instance_class
799405
def create(self, **kwargs):
        

        response = self.ghost.execute_post('%s/' % self._type_name, json={
            self._type_name: [
                kwargs
            ]
        })

        return self._model_type(response.get(self._type_name)[0])
89520
def set_alias(alias, **kwargs):
    

    spec = alias.split()
    path = spec[0]

    values = {**kwargs, 'path': path}

    if len(spec) > 1:
        values['template'] = spec[1]

    record = model.PathAlias.get(path=path)
    if record:
        record.set(**values)
    else:
        record = model.PathAlias(**values)

    orm.commit()
    return record
3467
def register(self, func, *args, **kwargs):
        
        self._open[-1].append(UndoOperation(func, *args, **kwargs))
        if not (self._undoing or self._redoing):
            self._redo = []
        self.notify()
734166
def register_modele(self, modele: Modele):
        
        self.lemmatiseur._modeles[modele.gr()] = modele
1197557
def register(self, sim, *args, **kwargs):
        
        kwargs.update(zip(self.meta_names, args))
        # call super method, now meta can be passed as args or kwargs.
        super(SimRegistry, self).register(sim, **kwargs)
40669
def register_plugin(cls, model, plugin):
        '''
        
        '''
        logger.info("Plugin registered for %s: %s", model, plugin)
        cls.plugins[model] = plugin