AdminUserPropertyData

class q2_sdk.hq.db.admin_user_property_data.AdminUserPropertyDataRow(element, row_class=None, rename_fields=None)[source]

Bases: TableRow

UserPropertyDataID: int
UISourceID: int
GroupID: int
UserID: int
PropertyID: int
PropertyValue: str
PropertyLongName: str
PropertyName: str
PropertyDataType: str
Weight: int
IsGroupProperty: bool
IsUserProperty: bool
class q2_sdk.hq.db.admin_user_property_data.AdminGroupPropertyRow(element, row_class=None, rename_fields=None)[source]

Bases: TableRow

UserPropertyDataID: int
GroupID: int
PropertyID: int
PropertyValue: str
PropertyName: str
PropertyLongName: str
class q2_sdk.hq.db.admin_user_property_data.AdminUserPropertyData(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 if False or TableRow objects from DB calls if True (Defaults to settings file)

REPRESENTATION_ROW_CLASS

alias of AdminUserPropertyDataRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get(property_name, user_id=None, group_id=None, fi_id=None, ui_source=None, return_count=10, strict=True, no_trunc=False, serialize_for_cli=False)[source]
Return type:

list[AdminUserPropertyDataRow]

async get_by_value(property_value, admin_user_property_name, no_trunc=False, serialize_for_cli=False)[source]
Return type:

list[AdminUserPropertyDataRow]

async get_all_group_properties(target_group_id=None, include_default_value_rows=True, page_number=1, page_size=200, serialize_for_cli=True)[source]

Gets values from the Q2_AdminUserPropertyData table for properties marked as group properties

Parameters:
  • target_group_id (Optional[int]) – Optional parameter to return only properties for a specific group

  • include_default_value_rows (bool) – default value rows hold property values that are used if a group does not have a row for a property. These rows will not have GroupID values returned (NULL in the database)

  • page_number (int) – the starting point for pagination.

  • page_size (int) – the number of rows to return per page

  • serialize_for_cli – flag for calling from the cli

Return type:

list[AdminGroupPropertyRow]

async create(property_name, property_value, user_id=None, group_id=None, fi_id=None, ui_source=None)[source]
async update(property_name, property_value, user_id=None, group_id=None, fi_id=None, ui_source=None)[source]
async update_by_id(admin_user_property_data_id, property_name, property_value)[source]
async delete(property_name, user_id=None, group_id=None, fi_id=None, ui_source=None, strict=True)[source]

Note: this only works in the dev environment