Login
Back to bricks list
Introduction Version

MultiViews

Class MultiView. This is use to multiple view in the same page

The view model is:

{
    "type": "multi-view"
    "data":
        "views": [
            {
                "view": {},
                "colspan": colspan,
                "rowspan": rowspan,
            },
            ...
        ],
}

Functions

__INIT__

[summary]

Parameters:
NameTypeDefault valueDescription
nb_of_columnsint Total number of columns of the grid
ADD_EMPTY_BLOCK

Add en empty block in the grid

Parameters:
NameTypeDefault valueDescription
colspanint 1 Nb of columns taken by the empty block, defaults to 1 , optional
rowspanint 1 Nb of rows taken by the empty block, defaults to 1 , optional
ADD_TECHNICAL_INFO

Add technical info

Parameters:
NameTypeDefault valueDescription
technical_infoTechnicalInfo
ADD_VIEW

Add a view to the multi view

:raises Exception: [description]

Parameters:
NameTypeDefault valueDescription
viewView View dict[str, any]
paramsDict Values for the config of the view [str, any]
colspanint 1 Nb of columns taken by the view in the grid, defaults to 1 , optional
rowspanint 1 Nb of rows taken by the view in the grid, defaults to 1 , optional
DATA_TO_DICT

Convert to dictionary

Parameters:
NameTypeDefault valueDescription
paramsConfigParams
Return type:
dict
GET_STYLE

Get style

Return type:
TypingStyle
GET_TECHNICAL_INFO

Get technical info dict

Parameters:
NameTypeDefault valueDescription
keystr
Return type:
TechnicalInfo
GET_TECHNICAL_INFO_DICT

Get technical info

Return type:
TechnicalInfoDict
GET_TITLE

Get title

Return type:
str
GET_TYPE

Get type

Return type:
ViewType
IS_FAVORITE

Is favorite

Return type:
bool
SET_FAVORITE

Set favorite

Parameters:
NameTypeDefault valueDescription
favoritebool
SET_STYLE

Set typing style for this view instance. This overrides the style defines in the view decorator and the default style of the view type With this you can define a custom style for a specific view instance when you view is generic.

Parameters:
NameTypeDefault valueDescription
styleTypingStyle
SET_TECHNICAL_INFO_DICT

Set technical info

Parameters:
NameTypeDefault valueDescription
technical_infoTechnicalInfoDict
SET_TITLE

Set title

Parameters:
NameTypeDefault valueDescription
titlestr
TO_DTO

Convert to DTO

Parameters:
NameTypeDefault valueDescription
paramsConfigParams
Return type:
ViewDTO
GENERATE_RANGE - @classmethod

Generate range list like 0,1,2...length

Parameters:
NameTypeDefault valueDescription
lengthint
Return type:
List
JSON_IS_FROM_VIEW - @classmethod

Method that return true is the provided json is a json of a view

Parameters:
NameTypeDefault valueDescription
json_Any
Return type:
bool