Disclaimer

class q2_sdk.hq.db.disclaimer.DisclaimerRow[source]

Bases: RepresentationRowBase

DisclaimerID: IntElement = 'DisclaimerID'
ShortName: StringElement = 'ShortName'
DisplayName: StringElement = 'DisplayName'
BundleDisplayName: StringElement = 'BundleDisplayName'
DisclaimerElementID: IntElement = 'DisclaimerElementID'
DisclaimerDataID: IntElement = 'DisclaimerDataID'
DisclaimerFormDataID: IntElement = 'DisclaimerFormDataID'
GroupID: IntElement = 'GroupID'
class q2_sdk.hq.db.disclaimer.Disclaimer(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 DisclaimerRow

GET_BY_NAME_KEY = 'ShortName'
NAME = 'Disclaimer'
add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get(serialize_for_cli=False)[source]
Return type:

List[DisclaimerRow]

async get_disclaimer_form_data(form_id=None, short_name=None, serialize_for_cli=False)[source]
async create(display_name, corresponding_form_shortname, ui_text_elem_shortname=None, short_name='', disclaimer_type='')[source]
async delete(short_name, disclaimer_bundle_prefix=None)[source]

Note: this only works in the dev environment

async accept_for_user_id(user_id, disclaimer_shortname_list)[source]
Parameters:
  • user_id (int) – Corresponds to Q2_User.UserID

  • disclaimer_shortname_list (List[str]) – List of Q2_Disclaimer.ShortName