MCPcopy
hub / github.com/reflex-dev/reflex / register

Method register

reflex/model.py:193–203  ·  view source on GitHub ↗

Register a model. Can be used directly or as a decorator. Args: model: The model to register. Returns: The model passed in as an argument (Allows decorator usage)

(cls, model: SQLModelOrSqlAlchemyT)

Source from the content-addressed store, hash-verified

191
192 @classmethod
193 def register(cls, model: SQLModelOrSqlAlchemyT) -> SQLModelOrSqlAlchemyT:
194 """Register a model. Can be used directly or as a decorator.
195
196 Args:
197 model: The model to register.
198
199 Returns:
200 The model passed in as an argument (Allows decorator usage)
201 """
202 cls.models.add(model)
203 return model
204
205 @classmethod
206 def get_models(cls, include_empty: bool = False) -> set[SQLModelOrSqlAlchemy]:

Callers 4

test_automigrationFunction · 0.80
_run_devFunction · 0.80
_run_prodFunction · 0.80
model.pyFile · 0.80

Calls

no outgoing calls

Tested by 1

test_automigrationFunction · 0.64