本文整理匯總了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")