Esempio n. 1
0
def user_to_json(user):
    return simplejson.dumps({
        "losses": user.losses,
        "rank": rank(user),
        "ranking": user.ranking,
        "rating": round(user.rating, OUTPUT_ROUND),
        "total": user.total,
        "username": user.username,
        "wins": user.wins,
    })
Esempio n. 2
0
def deck_to_json(deck):
    return simplejson.dumps({
        "losses": deck.losses,
        "rank": rank(deck),
        "ranking": deck.ranking,
        "rating": round(deck.rating, OUTPUT_ROUND),
        "slug": deck.slug,
        "total": deck.total,
        "trans": deck.trans,
        "wins": deck.wins,
    })