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)
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)
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)