From 48b78b5fdaf825fcf785c34c6a1fa03a769e66b4 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 19 Oct 2010 15:03:15 +0200 Subject: [PATCH] tickets: Add a Bookings.__unicode__() method. --- tickets/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tickets/models.py b/tickets/models.py index 5c56b0a..3229020 100644 --- a/tickets/models.py +++ b/tickets/models.py @@ -26,3 +26,10 @@ class Booking(models.Model): def _get_price(self): return self.tickets * TICKET_PRICE price = property(_get_price) + + def __unicode__(self): + return u'#%s: %s - %s - %s kaart%s (€ %.2d)' % ( + self.pk, self.name, + self.get_show_display(), + self.tickets, "en" if self.tickets != 1 else "", + self.price) -- 2.30.2