Esempio n. 1
0
def show_badge(request, identifier):
    """Shows a single badge."""
    badge = badges_by_id.get(identifier)
    if badge is None:
        raise NotFound()

    user_badges = UserBadge.query.filter_by(badge=badge) \
        .order_by(UserBadge.awarded.desc()).limit(20).all()
    return render_template('badges/show_badge.html', badge=badge,
                           user_badges=user_badges)
Esempio n. 2
0
def show_badge(request, identifier):
    """Shows a single badge."""
    badge = badges_by_id.get(identifier)
    if badge is None:
        raise NotFound()

    user_badges = UserBadge.query.filter_by(badge=badge) \
        .order_by(UserBadge.awarded.desc()).limit(20).all()
    return render_template('badges/show_badge.html', badge=badge,
                           user_badges=user_badges)
Esempio n. 3
0
 def process_result_value(self, value, dialect):
     if value is not None:
         from solace.badges import badges_by_id
         return badges_by_id.get(value)
Esempio n. 4
0
def get_badge(request, identifier):
    """Returns a single badge."""
    badge = badges_by_id.get(identifier)
    if badge is None:
        raise NotFound()
    return dict(badge=badge)
Esempio n. 5
0
def get_badge(request, identifier):
    """Returns a single badge."""
    badge = badges_by_id.get(identifier)
    if badge is None:
        raise NotFound()
    return dict(badge=badge)
Esempio n. 6
0
 def process_result_value(self, value, dialect):
     if value is not None:
         from solace.badges import badges_by_id
         return badges_by_id.get(value)