Ejemplo n.º 1
0
class DAGRunSection(Section):
    title = "Airflow Data"

    run_id = TextProperty(text="run_id", label="Identifier", translate=False)
    dag = URLProperty(url="get_dag_url",
                      text="dag.dag_id",
                      label="DAG",
                      external=False)
    execution_date = DateProperty(date="execution_date",
                                  label="Execution Date")
    user = TextProperty(text="user.display_name")
    state = StatusProperty(value="status", label="State")
    config = CodeProperty(code="get_conf_as_string",
                          label="Config",
                          language="json")

    @staticmethod
    def get_dag_url(run: DAGRun):
        return reverse(
            "connector_airflow:dag_detail",
            kwargs={
                "dag_id": run.dag.id,
            },
        )

    @staticmethod
    def get_conf_as_string(run: DAGRun):
        return json.dumps(run.conf, indent=2)
Ejemplo n.º 2
0
class DatabaseSection(Section):
    title = "PostgreSQL Data"

    hostname = TextProperty(text="hostname", translate=False)
    database = TextProperty(text="database", translate=False)
    username = TextProperty(text="username", translate=False)
    url = TextProperty(text="url", translate=False)
Ejemplo n.º 3
0
class TableSection(Section):
    title = "PostgreSQL Data"

    name = TextProperty(text="name", translate=False)
    rows = TextProperty(text="get_rows", label=_("Row count"), translate=False)

    def get_rows(self, table: Table):
        return f"{table.rows}"
Ejemplo n.º 4
0
class DatasetSection(Section):
    title = "DHIS2 Dataset"

    dhis2_id = TextProperty(label="ID", text="dhis2_id", translate=False)
    name = TextProperty(text="name")
    short_name = TextProperty(label="Short name", text="short_name")
    description = TextProperty(label="Description", text="description")
    code = TextProperty(label="Code", text="code", translate=False)
    created = DateProperty(label="Creation date", date="created")
    last_updated = DateProperty(label="Last updated", date="last_updated")
Ejemplo n.º 5
0
class ObjectSection(Section):
    title = StaticText("S3 Data")

    name = TextProperty(text="filename", translate=False)
    path = TextProperty(text="full_path", translate=False)
    file_type = TextProperty(label="File type",
                             text="type_display",
                             translate=False)
    file_size = TextProperty(label="File size",
                             text="file_size_display",
                             translate=False)
Ejemplo n.º 6
0
class DashboardMetaDataSection(Section):
    title = "OpenHexa Metadata"
    label = TextProperty(text="label", editable=True)
    description = TextProperty(text="description",
                               markdown=True,
                               editable=True)
    owner = OwnerProperty(url="owner.url", text="owner.name", editable=True)
    tags = TagProperty(value="tags.all", editable=True)
    countries = CountryProperty(value="countries", editable=True)

    class Meta:
        model = Index
Ejemplo n.º 7
0
class DAGSection(Section):
    title = "Airflow Data"

    dag_id = TextProperty(text="dag_id", label="Identifier", translate=False)
    schedule = TextProperty(text="schedule",
                            label="Schedule",
                            translate=False,
                            editable=True)
    user = UserProperty(user="******", label="Report to", editable=True)
    description = TextProperty(text="template.description", markdown=True)

    class Meta:
        model = DAG
Ejemplo n.º 8
0
class DataElementSection(Section):
    title = "DHIS2 Data"

    dhis2_id = TextProperty(label="ID", text="dhis2_id", translate=False)
    name = TextProperty(text="name")
    short_name = TextProperty(label="Short name", text="short_name")
    description = TextProperty(label="Description", text="description")
    code = TextProperty(label="Code", text="code", translate=False)
    domain_type = TextProperty(label="Domain type",
                               text="get_domain_type_display")
    value_type = TextProperty(label="Value type",
                              text="get_value_type_display")
    favourite = BooleanProperty(label="Favourite", value="favourite")
    external_access = BooleanProperty(label="External access",
                                      value="external_access")
    created = DateProperty(label="Creation date", date="created")
    last_updated = DateProperty(label="Last updated", date="last_updated")
Ejemplo n.º 9
0
class IndicatorSection(Section):
    title = "DHIS2 Indicator"

    dhis2_id = TextProperty(label="ID", text="dhis2_id", translate=False)
    name = TextProperty(text="name")
    short_name = TextProperty(label="Short name", text="short_name")
    description = TextProperty(label="Description", text="description")
    code = TextProperty(label="Code", text="code", translate=False)
    indicator_type = TextProperty(label="Indicator type",
                                  text="indicator_type.display_name")
    annualized = BooleanProperty(label="Annualized", value="annualized")
    favourite = BooleanProperty(label="Favourite", value="favourite")
    external_access = BooleanProperty(label="External access",
                                      value="external_access")
    created = DateProperty(label="Creation date", date="created")
    last_updated = DateProperty(label="Last updated", date="last_updated")
Ejemplo n.º 10
0
class BucketSection(Section):
    title = "GoogleCloudStorage Data"

    name = TextProperty(text="name", translate=False)
    content = TextProperty(text="content_summary")
Ejemplo n.º 11
0
class MainSection(Section):
    first_name = TextProperty(text="first_name")
    last_name = TextProperty(text="last_name")
Ejemplo n.º 12
0
class InstanceSection(Section):
    title = "DHIS2 Data"

    name = TextProperty(text="name", translate=False)
    locale = LocaleProperty(locale="locale")
    url = URLProperty(url="url")
Ejemplo n.º 13
0
class ClusterSection(Section):
    title = "Airflow Data"

    name = TextProperty(text="name", translate=False)
    url = URLProperty(url="web_url")
Ejemplo n.º 14
0
class BucketSection(Section):
    title = "S3 Data"

    name = TextProperty(text="name", translate=False)
    content = TextProperty(text="content_summary")