Пример #1
0
    def process_relations(self, container, containerid):
        schema = self.schema
        for name, relation in schema.relations.iteritems():

            logger.debug("Processing relation: %s - %s" %
                         (self.schema.fullname(), name))

            baseid = containerid + '-relation-%s' % name
            div = container.div(id=baseid, cls="relation-body")
            div.h4().text = relation.schema.fullname() + ": " + relation.name
            div.p().text = relation.description

            div.span(cls="h5").text = "Related resource"
            target_schema = RefSchemaProxy(relation, self.options,
                                           attrname='resource')
            p = div.p()
            p.settext(p.a(cls="jsonschema-type", href=target_schema.href,
                          text=target_schema.name))

            if relation.vars:
                div.span(cls="h5").text = "Variables"
                table = HTMLTable(cls="paramtable")
                table.row(["Related var", "Data value for replacement"],
                          header=True)
                for var, relp in relation.vars.iteritems():
                    table.row([var, relp])
                div.append(table)
Пример #2
0
    def __init__(self, data, options):
        self.options = options
        HTMLTable.__init__(self, cls="paramtable")

        logger.debug("PropTable")

        self.define_columns([
            "paramtable-propname", "paramtable-proptype",
            "paramtable-description", "paramtable-notes"
        ])
        self.row(["Property Name", "Type", "Description", "Notes"],
                 header=True)

        self.process(data)
Пример #3
0
    def __init__(self, data, options):
        self.options = options
        HTMLTable.__init__(self, cls="paramtable")

        logger.debug("PropTable")

        self.define_columns(["paramtable-propname",
                             "paramtable-proptype",
                             "paramtable-description",
                             "paramtable-notes"])
        self.row(["Property Name", "Type", "Description", "Notes"],
                 header=True)

        self.process(data)
Пример #4
0
    def process_relations(self, container, containerid):
        schema = self.schema
        for name, relation in schema.relations.items():

            logger.debug("Processing relation: %s - %s" %
                         (self.schema.fullname(), name))

            baseid = containerid + '-relation-%s' % name
            div = container.div(id=baseid, cls="relation-body")
            div.h4().text = relation.schema.fullname() + ": " + relation.name
            div.p().text = relation.description

            div.span(cls="h5").text = "Related resource"
            target_schema = RefSchemaProxy(relation,
                                           self.options,
                                           attrname='resource')
            p = div.p()
            p.settext(
                p.a(cls="jsonschema-type",
                    href=target_schema.href,
                    text=target_schema.name))

            if relation.vars:
                div.span(cls="h5").text = "Variables"
                table = HTMLTable(cls="paramtable")
                table.row(["Related var", "Data value for replacement"],
                          header=True)
                for var, relp in relation.vars.items():
                    table.row([var, relp])
                div.append(table)