Attributes
brick: CharField
brick_version: CharField
data: Dict
deprecated_message: CharField
deprecated_since: CharField
hide: BooleanField
human_name: CharField
model_type: CharField
object_sub_type: CharField
object_type: CharField
related_model_typing_name: CharField
short_description: CharField
style: TypingStyle
unique_name: CharField
Functions
__INIT__
Initialize self. See help(type(self)) for accurate signature.
CLONE
DELETE_INSTANCE
Parameters:
|
recursive | bool | False | |
delete_nullable | bool | False | |
DEPENDENCIES
Parameters:
|
search_nullable | bool | False | |
GET_ID
GET_MODEL_TYPE_DOC
Return the python documentation of the model type
IS_ALIAS
IS_DIRTY
IS_SAVED
Returns True if the model is saved in db, False otherwise
REFRESH_ANCESTORS
SAVE
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
:raises Exception: If the input data is not a dict
UNWRAP
AFTER_ALL_TABLES_INIT
- @classmethodMethod call after all the table are inited
Useful when use DeferredForeignKey to create the foreign key manually latter
AFTER_TABLE_CREATION
- @classmethodMethod call after the table is created
Usefull to create the full text indexes
BIND
- @classmethod Parameters:
|
database | Any | | |
bind_refs | bool | True | |
bind_backrefs | bool | True | |
_exclude | Any | | |
BIND_CTX
- @classmethod Parameters:
|
database | Any | | |
bind_refs | bool | True | |
bind_backrefs | bool | True | |
BULK_CREATE
- @classmethod Parameters:
|
model_list | Any | | |
batch_size | Any | | |
BULK_UPDATE
- @classmethod Parameters:
|
model_list | Any | | |
fields | Any | | |
batch_size | Any | | |
CLASSNAME
- @classmethodReturns the name of the class
Parameters:
|
slugify | bool | False | True to slugify the class name if true, defaults to false
, optional |
snakefy | bool | False | True to snakefy the class name if true, defaults to false
, optional |
replace_uppercase | bool | False | Replace upper cases by "-" if true, defaults to false
, optional |
COLUMN_EXISTS
- @classmethodReturns True if the column exists in the table
Parameters:
|
column_name | str | | The column name
`` |
CREATE_FOREIGN_KEY_IF_NOT_EXIST
- @classmethodCreate a foreign key for a Foreign key field only if the foreign key does not exists
Parameters:
|
field | ForeignKeyField | | [description] |
CREATE_FULL_TEXT_INDEX
- @classmethodMethod to create a full text index
Parameters:
|
columns | List | | [description]
[str] |
index_name | str | | |
CREATE_TABLE
- @classmethod DECORATED_METHOD_NAMES
- @classmethod DELETE
- @classmethod
DELETE_BY_ID
- @classmethod DROP_TABLE
- @classmethod EXECUTE_SQL
- @classmethodExecute a raw SQL query. Can use the [TABLE_NAME] to replace by the table name
Parameters:
|
query | str | | The query to execute
`` |
FOREIGN_KEY_EXISTS
- @classmethod FULL_CLASSNAME
- @classmethodReturns the full name of the class
Parameters:
|
slugify | bool | False | Slugify the returned class name if true, defaults to false
, optional |
snakefy | bool | False | Snakefy the returned class name if true, defaults to false
`` |
GET_BY_BRICK_AND_OBJECT_TYPE
- @classmethod GET_BY_BRICK_AND_UNIQUE_NAME
- @classmethod Parameters:
|
object_type | Literal | | |
brick | str | | |
unique_name | str | | |
GET_BY_ID_AND_CHECK
- @classmethodGet by ID and throw 404 error if object not found
GET_BY_IDS
- @classmethod GET_BY_MODEL_TYPE
- @classmethod GET_BY_OBJECT_SUB_TYPE
- @classmethod GET_BY_OBJECT_TYPE
- @classmethodReturn all the visible typing name of a type.
GET_BY_OBJECT_TYPE_AND_NAME
- @classmethodReturn all the visible typing name of a type searched by name.
Parameters:
|
object_type | Literal | | |
name | str | | |
GET_BY_TYPE_AND_BRICK
- @classmethodReturn all the visible typing name of a type.
Parameters:
|
object_type | Literal | | |
brick_name | str | | |
GET_BY_TYPING_NAME
- @classmethod GET_CHILDREN_TYPINGS
- @classmethodRetunr the list of typings that are a child class of the provided model_type
Parameters:
|
typing_type | Literal | | |
base_type | Type | | |
GET_DB_MANAGER
- @classmethodReturns the (current) DbManager of this model
GET_OR_CREATE
- @classmethod
GET_OR_NONE
- @classmethod GET_TABLE_NAME
- @classmethodReturns the table name of this class
INDEX_EXISTS
- @classmethodReturns True if the index exists in the table
Parameters:
|
index_name | str | | The index name
`` |
INHERITORS
- @classmethodGet all the classes that inherit this class
INSERT_FROM
- @classmethod INSERT_MANY
- @classmethod IS_MYSQL_ENGINE
- @classmethod
METHOD_NAMES
- @classmethodReturns the list of the methods
MODULE_NAME
- @classmethodReturns the module name of the class
NEW_MANUAL_PROTOCOL
- @classmethod Parameters:
|
graph | dict | | |
human_name | str | | |
short_description | str | | |
NOOP
- @classmethod
PROPERTY_METHOD_NAMES
- @classmethod
PROPERTY_NAMES
- @classmethodRetrieves the property names
Parameters:
|
instance | type | | The s of the properties to retrieve. set `none` to retrieve all.
`type` or `union[type]` |
exclude | type | | |
REPLACE_MANY
- @classmethod SAVE_ALL
- @classmethod
SEARCH
- @classmethodPerforms full-text search on the field. Must be overrided by child class to work
Parameters:
|
phrase | str | | The phrase to search
`` |
modifier | str | | |
TABLE_EXISTS
- @classmethod
TRUNCATE_TABLE
- @classmethod TYPE_IS_REGISTER
- @classmethod VALIDATE_MODEL
- @classmethod
TYPING_NAME_IS_PROTOCOL
- @staticmethod