def _blml_query(q): # {{{ listSchema = components.lookup1(q.schema, IListSchema) brevetree = components.lookup1(listSchema, IBlueLinesXML, 'api')(q.value) auth = api.get_current_user() return bluelines.tags.blueLines( version=_conf.VERSION, base=_conf.BASE_URL, auth=auth.email, )[ bluelines.tags.query(**q.props)[ brevetree.children[0] ] ]
def _blml_tree(name, data, fragments={}): # {{{ """ See templates in var/breve/xml, using nodes from tags.bluelines. """ tpl = Template(bluelines.tags, root=_conf.TPL_ROOT, xmlns=bluelines.xmlns) auth = api.get_current_user() brevetree = tpl._evaluate( _conf.BREVE_TPL('xml', name), fragments=fragments, vars={ '__'+name+'__': data, 'API': _conf.API, '__auth__': auth, }, ) return bluelines.tags.blueLines( version=_conf.VERSION, base=_conf.BASE_URL, auth=auth.email, )[brevetree]