def linksto(dictID, user, dictDB, configs): source_dict = request.query.source_dict source_el = request.query.source_el source_id = request.query.source_id target_el = request.query.target_el target_id = request.query.target_id res = ops.links_get(source_dict, source_el, source_id, dictID, target_el, target_id) return {"links": res}
def config(dictID, user, dictDB, configs): stats = ops.getDictStats(dictDB) links = {"out": {}, "in": {}} for link in ops.links_get(dictID, "", "", "", "", ""): if not link["target_dict"] in links["out"]: links["out"][link["target_dict"]] = [] links["out"][link["target_dict"]].append(link) for link in ops.links_get("", "", "", dictID, "", ""): if not link["source_dict"] in links["in"]: links["in"][link["source_dict"]] = [] links["in"][link["source_dict"]].append(link) return template( "links.tpl", **{ "siteconfig": siteconfig, "user": user, "dictID": dictID, "dictTitle": configs["ident"]["title"], "links": links })