From: Matthijs Kooijman Date: Tue, 19 Oct 2010 13:03:15 +0000 (+0200) Subject: tickets: Add a Bookings.__unicode__() method. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=48b78b5fdaf825fcf785c34c6a1fa03a769e66b4;p=matthijs%2Fprojects%2Fdorestad-bookings.git tickets: Add a Bookings.__unicode__() method. --- 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)