projects
/
matthijs
/
projects
/
dorestad-bookings.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33f124b
)
tickets: Add a Bookings.__unicode__() method.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Tue, 19 Oct 2010 13:03:15 +0000
(15:03 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Tue, 19 Oct 2010 13:03:15 +0000
(15:03 +0200)
tickets/models.py
patch
|
blob
|
history
diff --git
a/tickets/models.py
b/tickets/models.py
index 5c56b0aa82b0d99f2ef88e79215c77f43270e613..3229020872d4afd33f531b80fbaab2e7fe7cbca2 100644
(file)
--- 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)