# coding=utf-8
from django.db import models
+from django.utils.formats import number_format
# Create your models here.
TICKET_PRICE=7.5
-TICKETS_CHOICES = [ (n, u"%s (€%.2d)" % (n, n * TICKET_PRICE)) for n in range(1, 6)]
+TICKETS_CHOICES = [ (n, u"%s (€ %s)" % (n, number_format(n * TICKET_PRICE,2))) for n in range(1, 6)]
class Booking(models.Model):
created = models.DateTimeField(auto_now_add=True, editable=False, verbose_name="Datum")
price = property(_get_price)
def __unicode__(self):
- return u'#%s: %s - %s - %s kaart%s (€ %.2d)' % (
+ return u'#%s: %s - %s - %s kaart%s (€ %s)' % (
self.pk, self.name,
self.get_show_display(),
self.tickets, "en" if self.tickets != 1 else "",
- self.price)
+ number_format(self.price, 2))