Exemplo n.º 1
0
 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
Exemplo n.º 2
0
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]
Exemplo n.º 3
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]
    # 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]
Exemplo n.º 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]
Exemplo n.º 5
0
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]