From: Matthijs Kooijman Date: Tue, 19 Oct 2010 14:24:49 +0000 (+0200) Subject: tickets: Expose the ticket price to the bookingform template. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d08b3f2b82e6c0b82c0ef6e7146b17228eac71d7;p=matthijs%2Fprojects%2Fdorestad-bookings.git tickets: Expose the ticket price to the bookingform template. --- diff --git a/tickets/views.py b/tickets/views.py index 7c9e9fa..c89d26a 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -6,7 +6,7 @@ import django from django.shortcuts import render_to_response from django.template import RequestContext -from models import Booking +from models import Booking, TICKET_PRICE class BookingForm(django.forms.ModelForm): class Meta: @@ -63,7 +63,7 @@ def book(request): confirm_booking(booking, 'tickets/booked.eml') return render_to_response('tickets/booked.html', {'booking' : booking}, context_instance=RequestContext(request)) - return render_to_response('tickets/bookingform.html', {'form' : f}, context_instance=RequestContext(request)) + return render_to_response('tickets/bookingform.html', {'form' : f, 'price' : TICKET_PRICE}, context_instance=RequestContext(request)) # These two forms are used for entering payment details. They aren't # very different, so it should really be possible to merge them (but