def render(self): categories = meidodb.get_categories() l = ['<li><a href="/category/{0}">{1} ({2})</a></li>'.format( base64.urlsafe_b64encode(category['category']), category['category'], category['count']) for category in categories] return ''.join(l)
def render(self): categories = meidodb.get_categories() l = [ '<li><a href="/category/{0}">{1} ({2})</a></li>'.format( base64.urlsafe_b64encode(category['category']), category['category'], category['count']) for category in categories ] return ''.join(l)
def render(self, default): categories = meidodb.get_categories() l = [] for category in categories: if category['category'] == default: l.append('<option selected="selected">' + category['category'] + '</option>') else: l.append('<option>' + category['category'] + '</option>') return ''.join(l)