Register all models in *module* with the admin
    
    :param module: The module that contains the models
    :param exclude: A list of models classes that should not be registered
187530
def register_all(module, exclude=[], AdminClass=admin.ModelAdmin):
    
    member_names = dir(module)

    for member_name in member_names:
        obj = getattr(module, member_name, None)
        if isinstance(obj, ModelBase) \
            and obj not in exclude \
            and not obj._meta.abstract:
            try:
                if hasattr(obj, 'localized_fields'):
                    admin.site.register(obj, L10n(obj, AdminClass))
                else:
                    admin.site.register(obj, AdminClass)
            except AlreadyRegistered:
                pass
391409
static void registerAdditionalModules(
            final ObjectMapper objectMapper,
            final Function<String, String> propertyAccessor) {
        final String moduleClassNames = propertyAccessor.apply("commons.object-mapper-additional-module-class-names");
        if (moduleClassNames != null) {
            for (final String moduleClassName : moduleClassNames.split(",")) {
                registerModule(objectMapper, moduleClassName);
            }
        }
    }
307607
def exempt(self, obj):
        
        name = '%s.%s' % (obj.__module__, obj.__name__)

        @wraps(obj)
        def __inner(*a, **k):
            return obj(*a, **k)

        self._exempt_routes.add(name)
        return __inner
407834
def activate(self, *, filter_func=None):
        '''
        
        '''

        if self.active:
            raise RuntimeError("Type safety check already active")

        self.__module_finder = ModuleFinder(Validator.decorate)
        if filter_func is not None:
            self.__module_finder.set_filter(filter_func)
        self.__module_finder.install()
919341
def populate_model(model_or_inst, excludes=None, only=None):
    
    inst = model_or_inst if _is_inst(model_or_inst) else model_or_inst()

    parser = make_request_parser(model_or_inst, excludes, only, for_populate=True)
    req_args = parser.parse_args()

    for key, value in req_args.items():
        setattr(inst, key, value)

    return inst
1047758
def register(self, backbone_view_class):
        
        if backbone_view_class not in self._registry:
            self._registry.append(backbone_view_class)
875593
def _register_user_models(user_models, admin=None, schema=None):
    
    if any([issubclass(cls, AutomapModel) for cls in user_models]):
        AutomapModel.prepare(  # pylint:disable=maybe-no-member
                               db.engine, reflect=True, schema=schema)

    for user_model in user_models:
        register_model(user_model, admin)
1291750
def register(conf, conf_admin, **options):
    
    assert issubclass(conf_admin, ConfigAdmin), (
        'conf_admin is not a ConfigAdmin subclass')
    assert issubclass(
        getattr(conf_admin, 'change_list_form', None),
        ConfigForm), 'No change_list_form set'
    assert issubclass(conf, Config), (
        'conf is not a Config subclass')
    assert conf.app_label, 'No app_label set'
    assert conf.verbose_name_plural, 'No verbose_name_plural set'
    assert not conf.name or re.match(r"^[a-zA-Z_]+$", conf.name), (
        'Not a valid name. Valid chars are [a-zA-Z_]')
    config_class = type("Config", (), {})
    config_class._meta = type("Meta", (_ConfigMeta,), {
        'app_label': conf.app_label,
        'verbose_name_plural': conf.verbose_name_plural,
        'object_name': 'Config',
        'model_name': conf.name,
        'module_name': conf.name})
    admin.site.register([config_class], conf_admin, **options)
246690
def register(self, module):
        
        if module is not None:
            cmds = self.retrieve_commands(module)

            for c in cmds:
                if self.valid_name(c.name):
                    cmd = c(self.subparsers)
                    self.commands.append(cmd)
                else:
                    print(colored("Warning: Command %s has empty name. It won't be registered"
                                  % c, 'yellow'))
1190317
def validate_admin_registration(cls, model):
    

    if not is_multilingual_model(model):
        return

    from django.contrib.admin.validation import check_isdict, check_isseq

    opts = model._meta

    # this is heavily based on django.contrib.admin.validation.
    if hasattr(cls, '_dm_prepopulated_fields'):
        check_isdict(cls, '_dm_prepopulated_fields', cls.prepopulated_fields)
        for field, val in cls._dm_prepopulated_fields.items():
            f = get_field(cls, model, opts, 'prepopulated_fields', field)
            if isinstance(f, (models.DateTimeField, models.ForeignKey,
                models.ManyToManyField)):
                raise ImproperlyConfigured("'%s.prepopulated_fields['%s']' "
                        "is either a DateTimeField, ForeignKey or "
                        "ManyToManyField. This isn't allowed."
                        % (cls.__name__, field))
            check_isseq(cls, "prepopulated_fields['%s']" % field, val)
            for idx, f in enumerate(val):
                get_field(cls, model,
                        opts, "prepopulated_fields['%s'][%d]"
                        % (f, idx), f)
1072128
def register(self, *args, **kwargs):
        

        assert len(args) <= 2, 'register takes at most 2 args'
        assert len(args) > 0, 'register takes at least 1 arg'

        model, crudbuilder = self.__class__.extract_args(*args)

        if not issubclass(model, models.Model):
            msg = "First argument should be Django Model"
            raise NotModelException(msg)

        key = self._model_key(model, crudbuilder)

        if key in self:
            msg = "Key '{key}' has already been registered.".format(
                key=key
            )
            raise AlreadyRegistered(msg)

        self.__setitem__(key, crudbuilder)
        return crudbuilder
501421
def unregister_model(self, model):
        
        if model not in self._model_registry:
            raise NotRegistered('The model %s is not registered' % model)

        del self._model_registry[model]
463931
public void addAndRegisterAddOns(List<AddOnModel> addOns) {
        this.addOns.addAll(addOns);
        registerAllAddOns(this.addOns);
        initialized();
    }
929082
def add_module(self, module):
        '''
        
        '''
        for key, value in module.__dict__.iteritems():
            if key[0:2] != '__':
                self.__setattr__(attr=key, value=value)
1253047
def register_model(cls: Type[Model]):
    
    if not issubclass(cls, Model):
        raise TypeError("model bust be a subclass of Model")
    if issubclass(cls, GenericModel):
        raise TypeError("model must not be a subclass of GenericModel")
    __models__.add(cls)
    return cls
818088
def register_backend(mimetype, module, extensions=None):
    
    if mimetype in MIMETYPE_TO_BACKENDS:
        warn("overwriting %r mimetype which was already set" % mimetype)
    MIMETYPE_TO_BACKENDS[mimetype] = module
    if extensions is None:
        try:
            ext = _MIMETYPES_TO_EXT[mimetype]
        except KeyError:
            raise KeyError(
                "mimetypes module has no extension associated "
                "with %r mimetype; use 'extensions' arg yourself" % mimetype)
        assert ext, ext
        EXTS_TO_MIMETYPES[ext] = mimetype
    else:
        if not isinstance(extensions, (list, tuple, set, frozenset)):
            raise TypeError("invalid extensions type (got %r)" % extensions)
        for ext in set(extensions):
            ext = ext if ext.startswith('.') else '.' + ext
            assert ext, ext
            EXTS_TO_MIMETYPES[ext] = mimetype
997477
def exclude(self):
        
        exclude = self.VERSIONED_EXCLUDE

        if super(VersionedAdmin, self).exclude is not None:
            # Force cast to list as super exclude could return a tuple
            exclude = list(super(VersionedAdmin, self).exclude) + exclude

        return exclude