mstrio.modeling.schema.attribute package

Submodules

mstrio.modeling.schema.attribute.attribute module

class mstrio.modeling.schema.attribute.attribute.Attribute(connection: mstrio.connection.Connection, id: Optional[str] = None, name: Optional[str] = None, show_expression_as: Union[mstrio.modeling.schema.attribute.attribute.ExpressionFormat, str] = ExpressionFormat.TREE)

Bases: mstrio.utils.entity.Entity, mstrio.utils.entity.CopyMixin, mstrio.utils.entity.MoveMixin, mstrio.utils.entity.DeleteMixin

Python representation of MicroStrategy Attribute object.

id

attribute’s ID

name

attribute’s name

sub_type

string literal used to identify the type of a metadata object

description

attribute’s description

type

object type, ObjectTypes enum

subtype

object subtype, ObjectSubTypes enum

ext_type

object extended type, ExtendedType enum

ancestors

list of ancestor folders

date_created

creation time, DateTime object

date_modified

last modification time, DateTime object

destination_folder_id

a globally unique identifier used to distinguish between metadata objects within the same project

forms

the list of attribute forms

attribute_lookup_table

Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

key_form

a key form of an attribute

displays

The collections of attribute displays and browse displays

sorts

the collections of attribute sorts and browse sorts of the attribute.

relationships

the list of relationships that one attribute has.

is_embedded

If true indicates that the target object of this reference is embedded within this object. Alternatively if this object is itself embedded, then it means that the target object is embedded in the same container as this object.

owner

User object that is the owner

acg

access rights (See EnumDSSXMLAccessRightFlags for possible values)

acl

object access control list

version_id

the version number this object is currently carrying

add_child(child: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, joint_child: Optional[List[mstrio.modeling.schema.helpers.SchemaObjectReference]] = None, relationship_type: mstrio.modeling.schema.attribute.relationship.Relationship.RelationshipType = RelationshipType.ONE_TO_MANY, table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None) None

Add a child to the attribute.

Parameters
  • child – SchemaObjectReference of an attribute

  • joint_child – list of SchemaObjectReferences of an attributes

  • relationship_type – RelationshipType enum object, by default RelationshipType.ONE_TO_MANY

  • table – SchemaObjectReference of a lookup table, if not passed attribute lookup table is used

add_fact_expression(form_id: str, expression: mstrio.modeling.expression.fact_expression.FactExpression)

Add expression to the form. :param form_id: ID of the form to which the expression is to be added, :param expression: the expression that is to be added,

add_form(form: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm] = None, name: Optional[str] = None, expressions: Optional[List[mstrio.modeling.expression.fact_expression.FactExpression]] = None, lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, description: Optional[str] = None, category: Optional[str] = None, display_format: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat] = None, data_type: Optional[mstrio.modeling.schema.helpers.DataType] = None, alias: Optional[str] = None, child_forms: Optional[List[mstrio.modeling.schema.helpers.FormReference]] = None, geographical_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole] = None, time_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole] = None, is_form_group: bool = False, is_multilingual: bool = False)

Create new attribute form and add it to the attribute.forms list. The form can be added from completed AttributeForm objects provided in form patameter, or by filling other parameters.

Parameters
  • form – complete AttibuteForm object that will be added to the Attribute

  • name – The name of the attribute form set by the attribute. Unlike category, which is the systemic name associated with each reusable form, this name is specific to the attribute using this form

  • expressions – Array with a member object for each separately defined expression currently in use by a fact. Often a fact expression takes the form of just a single column name, but more complex expressions are possible.

  • lookup_table – lookup table of the AttributeForm. It has to be a lookup table used in one of the expressions assigned to AttributeForm

  • description – description of the AttributeForm

  • category – The category of the attribute form. Unlike name, this field is independent of the attribute using this form. This field can only be set when creating a new form. Once a form is created, its category becomes non-mutable. If not provided (or set as None) when an attribute is being created, a custom category will be automatically generated.

  • display_format – display format of the AttributeForm

  • data_type – Representation in the object model for a data-type that could be used for a SQL column.

  • alias – alias of the AttributeForm

  • child_forms – only used if ‘is_form_group’ is set to true

  • geographical_role – identifies the type of geographical information this form represents

  • time_role – time role of the AttributeForm

  • is_form_group – A boolean field indicating whether this form is a form group (if true) or a simple form (if false).

  • is_multilingual – A boolean field indicating whether this field is multilingual. Any key form of the attribute is not allowed to be set as multilingual.

add_parent(parent: mstrio.modeling.schema.helpers.SchemaObjectReference, relationship_type: mstrio.modeling.schema.attribute.relationship.Relationship.RelationshipType = RelationshipType.ONE_TO_MANY, table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None) None

Add a parent to the attribute.

Parameters
  • parent – SchemaObjectReference of an attribute

  • relationship_type – RelationshipType enum object, by default RelationshipType.ONE_TO_MANY

  • table – SchemaObjectReference of a lookup table, if not passed attribute lookup table is used

alter(sub_type: Optional[str] = None, name: Optional[str] = None, is_embedded: Optional[bool] = None, description: Optional[str] = None, destination_folder_id: Optional[str] = None, forms: Optional[List[mstrio.modeling.schema.attribute.attribute_form.AttributeForm]] = None, attribute_lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, key_form: Optional[mstrio.modeling.schema.helpers.FormReference] = None, displays: Optional[mstrio.modeling.schema.helpers.AttributeDisplays] = None, sorts: Optional[mstrio.modeling.schema.helpers.AttributeSorts] = None, relationships: Optional[mstrio.modeling.schema.attribute.relationship.Relationship] = None)

Alter attribute properties.

Parameters
  • name – attribute’s name

  • description – attribute’s description

  • is_embedded – If true indicates that the target object of this reference is embedded within this object. Alternatively if this object is itself embedded, then it means that the target object is embedded in the same container as this object.

  • destination_folder_id – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object Id.

  • forms – attribute’s forms list

  • attribute_lookup_table – Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

  • key_form – a key form of an attribute

  • displays – The collections of attribute displays and browse displays of the attribute.

  • sorts – The collections of attribute sorts and browse sorts of the attribute.

  • relationships – the list of relationships that one attribute has.

alter_fact_expression(form_id: str, fact_expression_id: str, expression: Optional[mstrio.modeling.expression.expression.Expression] = None, tables: Optional[List[mstrio.modeling.schema.helpers.SchemaObjectReference]] = None)

Alter fact expression of the attribute form with given ID :param form_id: ID of the form that uses certain expression :param fact_expression_id: ID of the fact expression that is to be altered, :param expression: new expressions of the fact expression :param tables: new tables of the fact expression

alter_form(form_id: str, name: Optional[str] = None, description: Optional[str] = None, display_format: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat] = None, data_type: Optional[mstrio.modeling.schema.helpers.DataType] = None, expressions: Optional[List[mstrio.modeling.expression.fact_expression.FactExpression]] = None, alias: Optional[str] = None, lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, child_forms: Optional[List[mstrio.modeling.schema.helpers.FormReference]] = None, geographical_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole] = None, time_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole] = None, is_form_group: Optional[bool] = None, is_multilingual: Optional[bool] = None)

Alter attribute form with a given form_id.

Parameters
  • form_id – ID of the attribute form that will be altered

  • name – The name of the attribute form set by the attribute. Unlike category, which is the systemic name associated with each reusable form, this name is specific to the attribute using this form

  • description – description of the AttributeForm

  • display_format – display format of the AttributeForm

  • data_type – Representation in the object model for a data-type that could be used for a SQL column.

  • expressions – Array with a member object for each separately defined expression currently in use by a fact. Often a fact expression takes the form of just a single column name, but more complex expressions are possible.

  • alias – alias of the AttributeForm

  • lookup_table – lookup table of the AttributeForm. It has to be a lookup table used in one of the expressions assigned to AttributeForm

  • child_forms – only used if ‘is_form_group’ is set to true

  • geographical_role – identifies the type of geographical information this form represents

  • time_role – time role of the AttributeForm

  • is_form_group – A boolean field indicating whether this form is a form group (if true) or a simple form (if false).

  • is_multilingual – A boolean field indicating whether this field is multilingual. Any key form of the attribute is not allowed to be set as multilingual.

static check_if_referenced_forms_exist(error_msg: str, forms: List[mstrio.modeling.schema.attribute.attribute_form.AttributeForm], refs: List[mstrio.modeling.schema.helpers.FormReference])

Check if all references point to a form in forms.

classmethod create(connection: mstrio.connection.Connection, name: str, sub_type: Union[mstrio.modeling.schema.helpers.ObjectSubType, str], destination_folder: Union[mstrio.object_management.folder.Folder, str], forms: List[mstrio.modeling.schema.attribute.attribute_form.AttributeForm], key_form: mstrio.modeling.schema.helpers.FormReference, displays: mstrio.modeling.schema.helpers.AttributeDisplays, description: Optional[str] = None, is_embedded: bool = False, attribute_lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, sorts: Optional[mstrio.modeling.schema.helpers.AttributeSorts] = None, show_expression_as: Union[mstrio.modeling.schema.attribute.attribute.ExpressionFormat, str] = ExpressionFormat.TREE) mstrio.modeling.schema.attribute.attribute.Attribute

Alter attribute properties.

Parameters
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name – attribute’s name

  • sub_type – attribute’s sub_type

  • destination_folder_id – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object Id.

  • forms – attribute’s forms list

  • key_form – a key form of an attribute

  • displays – The collections of attribute displays and browse displays of the attribute.

  • description – attribute’s description

  • is_embedded – If true indicates that the target object of this reference is embedded within this object. Alternatively if this object is itself embedded, then it means that the target object is embedded in the same container as this object.

  • attribute_lookup_table – Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

  • sorts – The collections of attribute sorts and browse sorts of the attribute.

  • show_expression_as (ExpressionFormat, str) – specify how expressions should be presented Available values: - ExpressionFormat.TREE or tree (default) - ExpressionFormat.TOKENS or `tokens

Returns

Attribute class object.

get_fact_expression(expression_id: str, form_id: Optional[str] = None, form_name: Optional[str] = None) Optional[mstrio.modeling.expression.fact_expression.FactExpression]

Retrieve a certain fact expression of a local instance of Attribute object.

Parameters
  • form_id – ID of the attribute form. It have priority over name parameter

  • form_name – name of the attribute form

  • expression_id – ID of the fact expression

get_form(id: Optional[str] = None, name: Optional[str] = None) Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm]

Retrieve a certain attribute form of a local instance of Attribute object.

Parameters
  • id – ID of the attribute form. It has priority over name parameter

  • name – name of the attribute form

list_relationship_candidates(already_used: bool = True, to_dictionary: bool = True) Union[dict, List[mstrio.modeling.schema.helpers.SchemaObjectReference]]

Lists potential relationship candidates for the Attribute.

Parameters
  • already_used – whether to show Attributes References, which are already parents or children

  • to_dictionary – whether to return results as a dict or list

Returns

Dictionary with table names as keys and list of SchemaObjectReferences of the attributes as values if to_dictionary set to True, list of SchemaObjectReference of attributes as list otherwise.

list_tables(expression: Optional[Union[mstrio.modeling.expression.fact_expression.FactExpression, str]] = None) List[mstrio.modeling.schema.helpers.SchemaObjectReference]

List all tables in the given expression. If expression is not specified, list all tables for attribute.

Parameters

expression – the expression for which to list tables

Returns

List of tables in the given expression or all tables for attribute.

remove_child(child: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, joint_child: Optional[List[mstrio.modeling.schema.helpers.SchemaObjectReference]] = None) None

Removes a child of the attribute.

Parameters
  • child – SchemaObjectReference of an attribute to be removed from child relationship

  • joint_child – list of SchemaObjectReferences of an attributes to be removed from joint child relationship

remove_fact_expression(form_id: str, fact_expression_id: str, new_lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None)

Remove expression from the form. If the expressions left are not using lookup table assigned to the form, provide new lookup table for the form.

Parameters
  • form_id – ID of the form from which the expression is to be removed,

  • expression_id – ID of the expression that is to be removed,

  • new_lookup_table – new lookup table of the form

remove_form(form_id: str, new_key_form: Optional[mstrio.modeling.schema.helpers.FormReference] = None)

Remove attribute form with a given form_id. If this form was present in displays or sorts, it will be automatically removed from there.

Parameters
  • form_id – ID of the form that should be removed

  • new_key_form – new value of the attribute’s key_form parameter. Mandatory if the form that is to be removed is the current key form, otherwise optional.

remove_parent(parent: mstrio.modeling.schema.helpers.SchemaObjectReference) None

Removes a parent of the attribute.

Parameters

parent – SchemaObjectReference of an attribute to be removed from parent relationship

to_dict(camel_case: bool = True) dict

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns

A dictionary representation of object’s attributes and values.

By default the dictionary keys are in camel case.

Return type

dict

classmethod validate_displays(displays: mstrio.modeling.schema.helpers.AttributeDisplays, forms: List[mstrio.modeling.schema.attribute.attribute_form.AttributeForm]) mstrio.modeling.schema.helpers.AttributeDisplays
static validate_key_form(key_form: mstrio.modeling.schema.helpers.FormReference, forms: List[mstrio.modeling.schema.attribute.attribute_form.AttributeForm], error_msg: Optional[str] = None) mstrio.modeling.schema.helpers.FormReference
classmethod validate_sorts(sorts: mstrio.modeling.schema.helpers.AttributeSorts, forms: List[mstrio.modeling.schema.attribute.attribute_form.AttributeForm]) Optional[mstrio.modeling.schema.helpers.AttributeSorts]
class mstrio.modeling.schema.attribute.attribute.ExpressionFormat(value)

Bases: mstrio.utils.enum_helper.AutoName

“Expression format to be fetched from server, it might be tree or token: - tree: tree data structure fully defining the expression. This format can be used if you want to examine and modify the expression programmatically. - tokens: list of parsed tokens. This format can be used if you want to examine and modify the expression using the parser component. Note that generating tokens requires additional time.

TOKENS = 'tokens'
TREE = 'tree'
mstrio.modeling.schema.attribute.attribute.list_attributes(connection: mstrio.connection.Connection, name: Optional[str] = None, attribute_subtype: Optional[mstrio.types.ObjectSubTypes] = None, to_dictionary: bool = False, limit: Optional[int] = None, search_pattern: Union[mstrio.object_management.search_enums.SearchPattern, int] = SearchPattern.CONTAINS, project_id: Optional[str] = None, show_expression_as: Union[mstrio.modeling.schema.attribute.attribute.ExpressionFormat, str] = ExpressionFormat.TREE, **filters) Union[List[mstrio.modeling.schema.attribute.attribute.Attribute], List[dict]]

Get list of Attribute objects or dicts with them. Optionally filter attributes by specifying ‘name’, ‘attribute_subtype’.

Optionally use to_dictionary to choose output format.

Wildcards available for ‘name’:

? - any character * - 0 or more of any characters e.g. name_begins = ?onny will return Sonny and Tonny

Parameters
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name (string, optional) – value the search pattern is set to, which will be applied to the names of attributes being searched

  • attribute_subtype (ObjectSubTypes) – one of attribute subtypes: attribute, attribute_abstract, attribute_recursive, attribute_role, attribute_transformation

  • to_dictionary (bool, optional) – If True returns dict, by default (False) returns Attribute objects

  • limit (integer, optional) – limit the number of elements returned. If None all object are returned.

  • project_id (str, optional) – Project ID

  • search_pattern (SearchPattern enum or int, optional) – pattern to search for, such as Begin With or Exactly. Possible values are available in ENUM mstrio.browsing.SearchPattern. Default value is CONTAINS (4).

  • show_expression_as (ExpressionFormat, str) –

    specify how expressions should be presented Available values:

    • ExpressionFormat.TREE or tree (default)

    • ExpressionFormat.TOKENS or `tokens

  • **filters

    Available filter parameters: id str: Attribute’s ID name str: Attribute’s name date_created str: format: 2001-01-02T20:48:05.000+0000 date_modified str: format: 2001-01-02T20:48:05.000+0000 version str: Attribute’s version owner dict: e.g. {‘id’: <user’s id>, ‘name’: <user’s name>},

    with one or both of the keys: id, name

    acg str | int: access control group

Returns

list with Attribute objects or list of dictionaries

mstrio.modeling.schema.attribute.attribute_form module

class mstrio.modeling.schema.attribute.attribute_form.AttributeForm(connection: mstrio.connection.Connection, id: str)

Bases: mstrio.utils.entity.Entity

The Attribute Form Object

Parameters
  • connection – a Connection object tied to the desired environment

  • id – Attribute Form ID. Note that Form ID is associated with the form category used. Multiple forms that use the same category will have the same ID. However, since no two forms within the same attribute can use the same category, no two forms will share an ID in the same attribute.

  • name – The name of the attribute form set by the attribute. Unlike category, which is the systemic name associated with each reusable form, this name is specific to the attribute using this form.

  • description – description of the AttributeForm

  • category – The category of the attribute form. Unlike name, this field is independent of the attribute using this form. This field can only be set when creating a new form. Once a form is created, its category becomes non-mutable. If not provided (or set as None) when an attribute is being created, a custom category will be automatically generated.

  • form_type – A read-only field indicating the type of this form. A custom form is created if its category is set to None.

  • display_format – display format of the AttributeForm

  • data_type – Representation in the object model for a data-type that could be used for a SQL column.

  • expressions – Array with a member object for each separately defined expression currently in use by a fact. Often a fact expression takes the form of just a single column name, but more complex expressions are possible.

  • alias – alias of the AttributeForm

  • lookup_table – lookup table of the AttributeForm. It has to be a lookup table used in one of the expressions assigned to AttributeForm

  • child_forms – only used if ‘is_form_group’ is set to true

  • geographical_role – identifies the type of geographical information this form represents

  • time_role – time role of the AttributeForm

  • is_form_group – A boolean field indicating whether this form is a form group (if true) or a simple form (if false).

  • is_multilingual – A boolean field indicating whether this field is multilingual. Any key form of the attribute is not allowed to be set as multilingual.

class DisplayFormat(value)

Bases: mstrio.utils.enum_helper.AutoName

Enumeration constants used to specify display format of the attribute form.

BIG_DECIMAL = 'big_decimal'
DATE = 'date'
DATE_TIME = 'date_time'
EMAIL = 'email'
HTML_TAG = 'html_tag'
NUMBER = 'number'
PHONE_NUMBER = 'phone_number'
PICTURE = 'picture'
SYMBOL = 'symbol'
TEXT = 'text'
TIME = 'time'
URL = 'url'
class FormType(value)

Bases: mstrio.utils.enum_helper.AutoName

Enumeration constants used to specify a type of this form.

CUSTOM = 'custom'
SYSTEM = 'system'
class GeographicalRole(value)

Bases: mstrio.utils.enum_helper.AutoName

Enumeration constants used to specify geographical role of the attribute form.

AREA_CODE = 'area_code'
CITY = 'city'
COUNTRY = 'country'
COUNTY = 'county'
GEOMETRY = 'geometry'
LATITUDE = 'latitude'
LOCATION = 'location'
LONGITUDE = 'longitude'
NONE = 'none'
OTHER = 'other'
STATE = 'state'
ZIP_CODE = 'zip_code'
class TimeRole(value)

Bases: mstrio.utils.enum_helper.AutoName

Enumeration constants used to specify time role of the attribute form.

DATE = 'date'
DAY = 'day'
DAY_OF_MONTH = 'day_of_month'
DAY_OF_QUARTER = 'day_of_quarter'
DAY_OF_WEEK = 'day_of_week'
DAY_OF_YEAR = 'day_of_year'
HOUR = 'hour'
HOUR_OF_DAY = 'hour_of_day'
MINUTE = 'minute'
MINUTE_OF_DAY = 'minute_of_day'
MINUTE_OF_HOUR = 'minute_of_hour'
MONTH = 'month'
MONTH_OF_QUARTER = 'month_of_quarter'
MONTH_OF_YEAR = 'month_of_year'
NONE = 'none'
QUARTER = 'quarter'
QUARTER_OF_YEAR = 'quarter_of_year'
SEASONAL_END = 'seasonal_end'
SEASONAL_ROOT = 'seasonal_root'
SECOND = 'second'
SECOND_OF_DAY = 'second_of_day'
SECOND_OF_HOUR = 'second_of_hour'
SECOND_OF_MINUTE = 'second_of_minute'
TIME = 'time'
WEEK = 'week'
WEEK_OF_MONTH = 'week_of_month'
WEEK_OF_QUARTER = 'week_of_quarter'
WEEK_OF_YEAR = 'week_of_year'
YEAR = 'year'
YEAR_OF_DECADE = 'year_of_decade'
get_fact_expression(id: str) mstrio.modeling.expression.fact_expression.FactExpression

Get a fact expression of a local instance of AttributeForm object.

Parameters

id – id of the fact expression

is_referenced_by(form_reference: mstrio.modeling.schema.helpers.FormReference) bool

Check if attribute form is referenced in form_reference.

list_properties(camel_case=True) dict

Lists all properties of attribute form.

local_alter(name: Optional[str] = None, description: Optional[str] = None, display_format: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat] = None, data_type: Optional[mstrio.modeling.schema.helpers.DataType] = None, expressions: Optional[List[mstrio.modeling.expression.fact_expression.FactExpression]] = None, alias: Optional[str] = None, lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, child_forms: Optional[List[mstrio.modeling.schema.helpers.FormReference]] = None, geographical_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole] = None, time_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole] = None, is_form_group: Optional[bool] = None, is_multilingual: Optional[bool] = None)

Make changes to a local copy of AttributeForm. In order to change an AttributeForm object on the server, use Attribute.alter_form() method of a corresponding Attribute object.

classmethod local_create(connection: mstrio.connection.Connection, name: str, description: Optional[str] = None, category: Optional[str] = None, display_format: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat] = None, data_type: Optional[mstrio.modeling.schema.helpers.DataType] = None, expressions: Optional[List[mstrio.modeling.expression.fact_expression.FactExpression]] = None, alias: Optional[str] = None, lookup_table: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, child_forms: Optional[List[mstrio.modeling.schema.helpers.FormReference]] = None, geographical_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole] = None, time_role: Optional[mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole] = None, is_form_group: bool = False, is_multilingual: bool = False) mstrio.modeling.schema.attribute.attribute_form.AttributeForm

Internal method that creates ONLY LOCAL AttributeForm object. In order to create an AttributeForm object on the server, use Attribute.add_form() method of a corresponding Attribute object.

to_dict(camel_case=True) dict

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns

A dictionary representation of object’s attributes and values.

By default the dictionary keys are in camel case.

Return type

dict

verify_is_simple_form(method_name_if_error: str)

mstrio.modeling.schema.attribute.relationship module

class mstrio.modeling.schema.attribute.relationship.Relationship(relationship_type: mstrio.modeling.schema.attribute.relationship.Relationship.RelationshipType, relationship_table: mstrio.modeling.schema.helpers.SchemaObjectReference, parent: mstrio.modeling.schema.helpers.SchemaObjectReference, child: Optional[mstrio.modeling.schema.helpers.SchemaObjectReference] = None, joint_child: Optional[List[mstrio.modeling.schema.helpers.SchemaObjectReference]] = None)

Bases: mstrio.utils.helper.Dictable

Python representation of MicroStrategy Attributes Relationship object.

parent

parent in a relationship

child

child in a relationship

joint_child

list of joint children in a relationship

relationship_table

relationship table in a relationship

ralationship_type

type of relationship, one of: one_to_many, one_to_one, many_to_many

class RelationshipType(value)

Bases: mstrio.utils.enum_helper.AutoName

Enumeration constants used to specify type of the relationship

MANY_TO_MANY = 'many_to_many'
ONE_TO_MANY = 'one_to_many'
ONE_TO_ONE = 'one_to_one'

Module contents