コード例 #1
0
ファイル: prints.py プロジェクト: encukou/ptcg-editor
 def family_query(self):
     query = self.request.db.query(tcg_tables.CardFamily)
     query = dbutil.order_by_name(query, tcg_tables.CardFamily)
     query = query.options(joinedload('names_local'))
     query = query.options(subqueryload('cards.prints'))
     query = query.options(subqueryload('cards'))
     return query
コード例 #2
0
ファイル: test_util.py プロジェクト: veekun/pokedex
def test_types_french_order(session):
    french = util.get(session, tables.Language, u'fr')
    types = session.query(tables.Type).filter(tables.Type.id < 10000)
    types = list(util.order_by_name(types, tables.Type, language=french))
    assert types[0].name_map[french] == 'Acier', types[0].name_map[french]
    # SQLite doesn't know how to sort unicode properly, so accented charaters come last.
    # Postgres doesn't have this problem.
    assert types[-1].name_map[french] in (u'Électrik', u'Vol'), types[-1].name_map[french]
コード例 #3
0
ファイル: test_util.py プロジェクト: snooter/pokedex
def test_types_french_order(session):
    french = util.get(session, tables.Language, 'fr')
    types = session.query(tables.Type).filter(tables.Type.id < 10000)
    types = list(util.order_by_name(types, tables.Type, language=french))
    assert types[0].name_map[french] == 'Acier', types[0].name_map[french]
    # SQLite doesn't know how to sort unicode properly, so accented charaters come last.
    # Postgres doesn't have this problem.
    assert types[-1].name_map[french] in (u'Électrik', u'Vol'), types[-1].name_map[french]
コード例 #4
0
def test_types_french_order(session):
    french = util.get(session, tables.Language, 'fr')
    types = session.query(tables.Type).filter(tables.Type.id < 10000)
    types = list(util.order_by_name(types, tables.Type, language=french))
    assert types[0].name_map[french] == 'Acier', types[0].name_map[french]
    assert types[-1].name_map[french] == 'Vol', types[-1].name_map[french]
コード例 #5
0
ファイル: test_util.py プロジェクト: DarkMatterz/pokedex
def test_types_french_order():
    french = util.get(session, tables.Language, 'fr')
    types = session.query(tables.Type).filter(tables.Type.id < 10000)
    types = list(util.order_by_name(types, tables.Type, language=french))
    assert types[0].name_map[french] == 'Acier', types[0].name_map[french]
    assert types[-1].name_map[french] == 'Vol', types[-1].name_map[french]