Register a new model (models)
596
def post(self):
        """"""
        self.set_header("Content-Type", "application/json")
        key = uuid.uuid4().hex
        metadata = json.loads(self.request.body.decode())
        metadata["uuid"] = key
        self.database[key] = metadata
        result = json.dumps({"uuid": key})
        self.write(result)
775830
def add_model(self, model):
        
        logger.debug(
            'adding model {} to group {}'.format(model.name, self.name))
        self.models[model.name] = model
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)
28202
def register_type(*args)
      if types_list.respond_to?(:add)
        types_list.add self, *args
      else
        types_list << self
      end
      if types_tracker_base.respond_to?(:scope) &&
          !types_tracker_base.respond_to?(model_name.element)
        type_name = name
        types_tracker_base.scope model_name.element, -> { where(type: type_name) }
      end
    end
876184
def register_for_app(
        self, app_label=None, exclude_models=None, exclude_model_classes=None
    ):
        
        models = []
        exclude_models = exclude_models or []
        app_config = django_apps.get_app_config(app_label)
        for model in app_config.get_models():
            if model._meta.label_lower in exclude_models:
                pass
            elif exclude_model_classes and issubclass(model, exclude_model_classes):
                pass
            else:
                models.append(model._meta.label_lower)
        self.register(models)
1282409
function register(metamodel) {
        var name, metaType;

        // Registering MetaTypes to global.meta
        for (name in metamodel) {
            if (metamodel.hasOwnProperty(name)) {
                metaType = metamodel[name];
                metaType.name = name;

                // Check duplicated MetaType
                if (_global.meta[name]) {
                    delete metamodel[name];
                    console.error("[MetaModelManager] MetaType '" + name + "' is already exists.");
                } else {
                    _global.meta[name] = metaType;
                }
            }
        }

        // Validate MetaTypes
        for (name in metamodel) {
            if (metamodel.hasOwnProperty(name)) {
                metaType = metamodel[name];
                try {
                    validateMetaType(name, metaType);
                } catch (err) {
                    console.error(err);
                }
            }
        }
    }
390102
function init(_models) {
  _.forEach(_models, (model) =>  {
    models[model.modelName] = model;
  });

  generateTypeDefs(models);
  generateNodeDefinitions(models);
}
1063904
public function registerPropelModelLoader()
    {
        $loader = new ClassLoader();

        $loader->addPrefix(
            '', // no prefix, models already define their full namespace
            $this->getPropelModelDir()
        );

        $loader->register(
            true // prepend the autoloader to use cached models first
        );
    }
829278
function(mod, data) {
        if (!Model || !Model[mod]) {
          debug("can't find model : " + mod);
          return;
        }

        return (new Model[mod](data));
      }
116030
def new(self, *args, **kwargs):
        '''
'''
        return self.session().add(self.model(*args, **kwargs))
515599
protected function register()
    {
        // Setup taxonomy relationships.
        $this->relation();

        // Make taxonomy model for the factory.
        $this->setModel($this->makeTaxonomyModel());

        // Build taxonomy with model and singularity holders.
        $this->setSingularity($this->makeTaxonomyInstance());

        // Set fields to the taxonomy.
        if ($this->methodExist('fields')) {
            $this->registerFields();
        }

        // Set columns to the taxonomy, after admin init.
        if ($this->methodExist('columns')) {
            $this->registerColumns();
        }
    }
31885
def register(self, *handlers, **params):
        
        for handler in handlers:

            if issubclass(handler, PWModel):
                handler = type(
                    handler._meta.db_table.title() + 'Admin',
                    (PWAdminHandler,), dict(model=handler, **params))
                self.app.register(handler)
                continue

            name = handler.name.lower()
            self.handlers[name] = handler
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)
621724
def register(self, model, **attr):
        
        metadata = self.metadata
        if not isinstance(model, Table):
            model_name = self._create_model(model, **attr)
            if not model_name:
                return
            model, name = model_name
            table = model.__table__
            self._declarative_register[name] = model

            if name in self._bases:
                for model in self._bases.pop(name):
                    self.register(model)
        else:
            table = model.tometadata(metadata)
            model = table

        # Register engine
        engine = None
        label = table.info.get('bind_label')
        keys = ('%s.%s' % (label, table.key),
                label, None) if label else (None,)
        #
        # Find the engine for this table
        for key in keys:
            engine = self.get_engine(key)
            if engine:
                break
        assert engine
        self.binds[table] = engine

        return model
614633
def _create_model(model, ident, **params):
    
    with log_errors(pdb=True):
        model = clone(model).set_params(**params)
        return model, {"model_id": ident, "params": params, "partial_fit_calls": 0}
823700
protected function registerModelGenerator()
	{
		$this->app['generate.model'] = $this->app->share(function($app)
		{
			$cache = new Cache($app['files']);
			$generator = new Generators\ModelGenerator($app['files'], $cache);

			return new Commands\ModelGeneratorCommand($generator);
		});
	}
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]