UserPropertyData
- class q2_sdk.hq.db.user_property_data.UserPropertyDataRow(element, row_class=None, rename_fields=None)[source]
Bases:
TableRow
- class q2_sdk.hq.db.user_property_data.UserPropertyData(logger, hq_credentials=None, ret_table_obj=None)[source]
Bases:
DbObject
Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.
- Parameters:
logger – Reference to calling request’s logger (self.logger in your extension)
hq_credentials (
Optional
[HqCredentials
]) – HQ Connectivity Information (Defaults to settings file)ret_table_obj (
Optional
[bool
]) – Flag to return list of LXML elements ifFalse
or TableRow objects from DB calls ifTrue
(Defaults to settings file)
- REPRESENTATION_ROW_CLASS
alias of
UserPropertyDataRow
- async get(user_property_name, user_id=None, group_id=None, customer_id=None, host_account_id=None, ui_source=None, product_id=None, product_type_id=None, return_count=10, strict=True, no_trunc=False, serialize_for_cli=False, user_role_id=None)[source]
- Return type:
- async get_by_value(property_value, user_property_name, no_trunc=False, serialize_for_cli=False)[source]
- Return type:
- async get_by_property_id(property_id)[source]
This method will return user_property_data using by PropertyID.
- Return type:
- async get_by_group(user_property_name, serialize_for_cli=False)[source]
This method will include the default property value in the return. The default value will be the only value that does not have a group id associated
- Return type:
- async get_by_group_with_id(user_property_id)[source]
This method will include the default property value in the return. The default value will be the only value that does not have a group id associated
- Return type:
- async get_by_customer_id(customer_id, user_property_name=None, user_property_id=None)[source]
- Return type:
- async create(property_name, property_value, user_id=None, group_id=None, customer_id=None, host_account_id=None, ui_source=None, product_id=None, product_type_id=None, product_name=None, product_type_name=None, user_role_id=None)[source]
- async update(property_name, property_value, user_id=None, group_id=None, customer_id=None, host_account_id=None, ui_source=None, product_id=None, product_type_id=None, product_name=None, product_type_name=None, user_role_id=None)[source]
- async create_or_update(property_name, property_value, user_id=None, group_id=None, customer_id=None, host_account_id=None, ui_source=None, product_id=None, product_type_id=None, product_name=None, product_type_name=None, user_role_id=None)[source]
There may be times when we want to error if a row already exists (create only). This method exists in case you just want a row to be there after you’re done calling the function, regardless of the initial state of the DB