本文整理汇总了Python中clld.db.models.common.Language.first方法的典型用法代码示例。如果您正苦于以下问题:Python Language.first方法的具体用法?Python Language.first怎么用?Python Language.first使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clld.db.models.common.Language
的用法示例。
在下文中一共展示了Language.first方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_CLLDRequest
# 需要导入模块: from clld.db.models.common import Language [as 别名]
# 或者: from clld.db.models.common.Language import first [as 别名]
def test_CLLDRequest(self):
self.assertTrue(isinstance(self.env['request'].purl, URL))
c = self.env['request'].db.query(Contribution).first()
self.env['request'].resource_url(c, ext='geojson')
self.assertEqual(None, self.env['request'].ctx_for_url('/some/path/to/nowhere'))
self.env['request'].file_url(Language_files(id='1', object=Language.first()))
assert self.env['request'].get_datatable('valuesets', ValueSet)
示例2: test_CLLDRequest
# 需要导入模块: from clld.db.models.common import Language [as 别名]
# 或者: from clld.db.models.common.Language import first [as 别名]
def test_CLLDRequest(env):
assert isinstance(env['request'].purl, URL)
c = env['request'].db.query(Contribution).first()
env['request'].resource_url(c, ext='geojson')
assert env['request'].ctx_for_url('/some/path/to/nowhere') is None
assert env['request'].ctx_for_url('/')
env['request'].file_url(Language_files(id='1', object=Language.first()))
assert env['request'].get_datatable('valuesets', ValueSet)
assert env['request'].blog is None
示例3: test_get_feature
# 需要导入模块: from clld.db.models.common import Language [as 别名]
# 或者: from clld.db.models.common.Language import first [as 别名]
def test_get_feature(data):
l = Language.first()
assert geojson.get_feature(l)['id'] == l.id
assert geojson.get_feature(l)['properties']['name'] == l.name
assert geojson.get_feature(l, name='geo')['properties']['name'] == 'geo'
示例4: get_query
# 需要导入模块: from clld.db.models.common import Language [as 别名]
# 或者: from clld.db.models.common.Language import first [as 别名]
def get_query(self, *args, **kw):
return [Language.first()]
示例5: test_get_feature
# 需要导入模块: from clld.db.models.common import Language [as 别名]
# 或者: from clld.db.models.common.Language import first [as 别名]
def test_get_feature(self):
l = Language.first()
self.assertEquals(geojson.get_feature(l)["id"], l.id)
self.assertEquals(geojson.get_feature(l)["properties"]["name"], l.name)
self.assertEquals(geojson.get_feature(l, name="geo")["properties"]["name"], "geo")