def delete(self, deck_id=None): if users.is_current_user_admin(): c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) c.title = " | " + c.deck.name return render('/delete_deck.mako') else: #XXX Proper http error here raise 'error'
def quiz(self, deck_id=None): c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) c.title = "| " + c.deck.name + " Quiz" c.reverse = bool(request.params.get('reverse', False)) return render('quiz_deck.mako')
def xml(self, deck_id=None): response.headers['Content-type'] = "Content-Type: application/xml; charset=utf-8" c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) return render('/xml_deck.mako')
def view(self, deck_id=None): c.is_admin = users.is_current_user_admin() c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) c.title = " | " + c.deck.name return render('/show_deck.mako')