ResourceModel
ResourceModel class.
brick_version: strdata: dict[str, Any]flagged: boolfolder: SpaceFolderfs_node_model: FSNodeModel | Nonegenerated_by_port_name: str | Noneid: strname: strorigin: ResourceOriginparent_resource_id: str | Nonescenario: Scenario | Nonestyle: TypingStyletask_model: TaskModel | NoneInitialize self. See help(type(self)) for accurate signature.
bool - Truebool - Truebool - Falsetype[Resource]KVStore | NoneReturns the resource created from the data and resource_typing_name if new_instance, it forces to rebuild the resource
bool - FalseResourcetype[Resource] | NoneTechnicalInfoDictFSNodeFSNodeboolboolboolReturns True if the model is saved in db, False otherwise
boolModelTypeRemove the kv store if it exists
Sets the data
set force_insert to True to force creation of the object
set skip_hook to True to skip the before insert or update hook
ModelTypestrResourceModelstrResourceModelDTOResourceModelExportDTOResourceSimpleDTOUpdate the resource model fields from a modified resource.
This method is used to persist changes made to RFields of an existing resource (e.g., after modifying disable_auto_stop on an AppResource). It unlocks the existing kv_store, clears all its keys, and recreates them by calling _receive_fields_from_resource.
ResourceResourceModelAnyCreate the foreign keys because it was deffered
Method call after the table is created
Usefull to create the full text indexes
AnyAnybool - Truebool - TrueAnyAnybool - Truebool - TrueAnyAnyAnyAnyAnyReturns the name of the class
bool - Falsebool - Falsebool - FalsestrClear folders from all the entities that have the folder
listReturns True if the column exists in the table
strboolAnyCreate a foreign key for a Foreign key field only if the foreign key does not exists
ForeignKeyFieldMethod to create a full text index
liststrCreate model table
AnystrModelDeletelist[ResourceModel]strDrop model table
Execute a raw SQL query. Can use the [TABLE_NAME] to replace by the table name
strAnyAnystrResourceModel | NonestrboolCreate a new ResourceModel from a resource
Don't set the resource here so it is regenerate on next get ( avoid using same instance)
ResourceResourceOrigin - ResourceOrigin.GENERATEDScenario | NoneTaskModel | Nonestr | Nonebool | Nonestr | NoneResourceModelReturns the full name of the class
bool - Falsebool - FalsestrAnyAnystrOptionalGet by ID and throw 404 error if object not found
strModelTypelistliststrModelSelectlist[str]ModelSelectstrModelSelectlist[str]ModelSelectlist[str]ModelSelectReturn the expression to search resource base on a type and all its subtypes.
If the Resource type is provided, it returns None
list[str]Expression | NoneDatabaseProxyReturns the (current) DbManager of this model
AbstractDbManagerModelMetadataAnyAnystrboolModelSelectReturns the table name of this class
str | NoneAnyReturns True if the index exists in the table
strboolGet all the classes that inherit this class
listAnyAnyAnyAnyAnyAnyReturns True if the class has a table name defined
boolAnyAnyAnyAnyAnyAnyCreate the ResourceModel from the Resource and save it
ResourceResourceOrigin - ResourceOrigin.GENERATEDScenario | NoneTaskModel | Nonestr | Nonebool | Nonebool - Falsestr | NoneResourceModelPerforms full-text search on the field. Must be overrided by child class to work
strstr | NoneModelSelectAnystrModelSelectselect resource by type of any subclass of this type
type[Resource]ModelSelectAnyAnyAnyAnyAnyAny