Source code for q2_sdk.hq.db.base

import json
from .db_object import DbObject


[docs] class InstallerObj(DbObject): """DbObject with special logic for get_installed compatibility"""
[docs] @staticmethod def _is_customer_created(row) -> str: """Looks in various columns for IsCustomerCreated json object""" column_names = ["Advanced", "WedgeJsonData", "Description"] for name in column_names: data = row.findtext(name) if data: break if not data: data = "<null>" try: json_adv = json.loads(data) result = json_adv.get("sdk") except (json.decoder.JSONDecodeError, AttributeError): result = "<null>" if result == "Customer": return "True" elif result == "Q2": return "False" return "<null>"