本文整理汇总了Python中nomenklatura.model.Dataset.all方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.all方法的具体用法?Python Dataset.all怎么用?Python Dataset.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nomenklatura.model.Dataset
的用法示例。
在下文中一共展示了Dataset.all方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reconcile_index
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def reconcile_index(dataset):
domain = url_for('index', _external=True).strip('/')
urlp = domain + '{{id}}'
meta = {
'name': 'nomenklatura',
'identifierSpace': 'http://rdf.freebase.com/ns/type.object.id',
'schemaSpace': 'http://rdf.freebase.com/ns/type.object.id',
'view': {'url': urlp},
'preview': {
'url': urlp + '?preview=true',
'width': 600,
'height': 300
}
}
if dataset is not None:
meta['name'] = dataset.label
meta['suggest'] = {
'entity': {
'service_url': domain,
'service_path': '/' + dataset.name + '/suggest',
'flyout_service_path': '/flyout'
}
}
meta['defaultTypes'] = [{'name': dataset.label, 'id': '/' + dataset.name}]
else:
meta['defaultTypes'] = [{'name': d.label, 'id': '/' + d.name} for d in Dataset.all()]
return jsonify(meta)
示例2: set_template_globals
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def set_template_globals():
return {
"datasets": Dataset.all(),
"authz": authz,
"avatar_url": session.get("avatar_url", ""),
"logged_in": request.account is not None,
"login": request.account.login if request.account else None,
}
示例3: set_template_globals
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def set_template_globals():
return {
'datasets': Dataset.all(),
'authz': authz,
'avatar_url': session.get('avatar_url', ''),
'logged_in': request.account is not None,
'login': request.account.login if request.account else None
}
示例4: index
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def index():
datasets = Dataset.all()
pager = Pager(datasets)
return jsonify(pager.to_dict())
示例5: index
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def index():
format = response_format()
if format == 'json':
return jsonify(Dataset.all())
return "Not implemented!"
示例6: index
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def index():
datasets = Dataset.all().order_by(Dataset.label.asc())
return render_template("index.html", datasets=datasets)
示例7: index
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def index():
datasets = Dataset.all()
return query_pager(datasets)
示例8: index
# 需要导入模块: from nomenklatura.model import Dataset [as 别名]
# 或者: from nomenklatura.model.Dataset import all [as 别名]
def index():
datasets = Dataset.all()
return render_template('index.html', datasets=datasets)