示例#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)
示例#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)
示例#3
0
文件: database.py 项目: Plurk/Solace
 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)
示例#4
0
文件: api.py 项目: jlsandell/solace
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)
示例#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)
示例#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)