Esempio n. 1
0
    def _makeOne(self, *args, **kwargs):
        from block.komet.mapping import get_mapping_function_factory
        mapping = get_mapping_function_factory(self.config, name="json")

        target = self._getTarget()
        from block.komet.sqla import ColumnsWalkingTemplate
        return target(ColumnsWalkingTemplate, mapping)
Esempio n. 2
0
def setup_views(config):
    from block.komet.mapping import (
        get_mapping_function_factory
    )
    from block.komet.pyramid.examples.sqla import (
        detail_view_category,
        list_view_category,
        install_komet_resource
    )
    mapping = get_mapping_function_factory(config, name="python")
    komet_resource_factory = install_komet_resource(config, session_factory, mapping, name="komet")

    builder = config.view_registering_builder("api", komet_resource_factory)
    vcs = builder.view_category_set
    detail_view_category(vcs, name="detail")
    list_view_category(vcs, name="list")

    ## todo:available options
    builder.build(config, User, {"list": {"list": {"producing": {"order_by": "id desc"}}}})
Esempio n. 3
0
 def _makeOne(self, name):
     from block.komet.mapping import get_mapping_function_factory
     return get_mapping_function_factory(self.config, name=name)