Form

class q2_sdk.hq.db.form.UiTextIds(demo, display, html)

Bases: tuple

UiTextIds(demo, display, html)

Create new instance of UiTextIds(demo, display, html)

demo

Alias for field number 0

display

Alias for field number 1

html

Alias for field number 2

class q2_sdk.hq.db.form.FormRow[source]

Bases: BaseFormRow

AccountHydraProductCodes: StringElement = 'AccountHydraProductCodes'
AccountRightsBitFlag: IntElement = 'AccountRightsBitFlag'
AccountRightsIsExplicit: StringElement = 'AccountRightsIsExplicit'
Advanced: StringElement = 'Advanced'
Config: StringElement = 'Config'
FormID: IntElement = 'FormID'
CallWedgeBeforeRender: BoolElement = 'CallWedgeBeforeRender'
DemoHtmlUiTextElementID: IntElement = 'DemoHtmlUiTextElementID'
DisplayNameUiTextElementID: IntElement = 'DisplayNameUiTextElementID'
DisplayNameUiTextElementShortName: StringElement = 'DisplayNameUiTextElementShortName'
HtmlDataUiTextElementID: IntElement = 'HtmlDataUiTextElementID'
MessageRecipientGroupID: IntElement = 'MessageRecipientGroupID'
NewWindow: BoolElement = 'NewWindow'
ShortName: StringElement = 'ShortName'
Url: StringElement = 'Url'
WedgeAddressID: IntElement = 'WedgeAddressID'
WedgePathName: StringElement = 'WedgePathName'
PropertyID: IntElement = 'PropertyID'
class q2_sdk.hq.db.form.CentralFormRow[source]

Bases: BaseFormRow

FormID: IntElement = 'FormID'
ShortName: StringElement = 'ShortName'
Url: StringElement = 'Url'
Config: StringElement = 'Config'
Description: StringElement = 'Description'
WedgePathName: StringElement = 'WedgePathName'
CallWedgeBeforeRender: BoolElement = 'CallWedgeBeforeRender'
HtmlData: StringElement = 'HtmlData'
FormParentID: IntElement = 'FormParentID'
WedgeAddressTypeName: StringElement = 'WedgeAddressTypeName'
PropertyID: IntElement = 'PropertyID'
class q2_sdk.hq.db.form.GroupsWithContext(property_id, groups, property_name, property_long_name)[source]

Bases: object

GroupsWithContext(property_id: str, groups: list[str], property_name: str | None, property_long_name: str | None)

property_id: str
groups: list[str]
property_name: str | None
property_long_name: str | None
async q2_sdk.hq.db.form.get_form_groups(logger, hq_credentials, property_id)[source]
Return type:

list[str]

async q2_sdk.hq.db.form.add_groups_to_forms(logger, hq_credentials, forms)[source]
Return type:

list[BaseFormRow]

async q2_sdk.hq.db.form.add_groups_to_form(logger, hq_credentials, form)[source]
class q2_sdk.hq.db.form.Form(logger, hq_credentials=None, ret_table_obj=None)[source]

Bases: InstallerObj

Allows for operations on Online form and Central forms.

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)

GET_BY_NAME_KEY = 'ShortName'
NAME = 'Form'
REPRESENTATION_ROW_CLASS

alias of FormRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get(serialize_for_cli=False, form_id=None, with_groups=False)[source]
Parameters:
  • serialize_for_cli – Used when running from the command line

  • form_id (Optional[int]) – Q2_Form.FormID

  • with_groups – Include group associations (can be costly for large payloads)

Return type:

list[FormRow]

async get_central(serialize_for_cli=False, form_id=None)[source]
Return type:

list[CentralFormRow]

async create(install_params)[source]
Return type:

FormRow

async create_central(install_params)[source]
Return type:

CentralFormRow

async get_by_name(name, **kwargs)[source]
Return type:

FormRow

async delete(short_name, skip_wedge_address=False)[source]
async delete_central(short_name)[source]
async update(short_name, url, config, account_rights_bit_flag, db_plan_requirements=None, property_id=None)[source]
async update_central(short_name, url, config, db_plan_requirements=None)[source]