def translations_mongodb_urls_xml(lang, target, url): apps = {} collections = retrieve_mongodb_contents() for app in collections['translation_urls']: cur_url = app['url'] cur_bundle = app['bundle'] cur_lang, cur_target = cur_bundle.rsplit('_', 1) if cur_url == url and cur_lang == lang and cur_target == target: resp = make_response(messages_to_xml(json.loads(app['data']))) resp.content_type = 'application/xml' return resp return "Not found", 404
def translations_mongodb_urls(): apps = {} collections = retrieve_mongodb_contents() for app in collections['translation_urls']: url = app['url'] bundle = app['bundle'] lang, target = bundle.rsplit('_', 1) if url not in apps: apps[url] = [] apps[url].append({ 'target' : target, 'lang' : lang }) return render_template("translator/mongodb_listing.html", apps = apps, title = "URLs", xml_method = '.translations_mongodb_urls_xml')
def translations_mongodb(): collections = {} contents = retrieve_mongodb_contents() for collection, collection_contents in contents.iteritems(): collections[collection] = json.dumps(collection_contents, indent = 4) return render_template("translator/mongodb.html", collections = collections)
def translations_mongodb(): collections = {} contents = retrieve_mongodb_contents() for collection, collection_contents in contents.iteritems(): collections[collection] = json.dumps(collection_contents, indent = 4) return render_template("translator/mongodb.html", collections = collections)