def view(request, id, guid=None, template_name="payments/view.html"): payment = get_object_or_404(Payment, pk=id) if not payment.allow_view_by(request.user, guid): raise Http403 payment.amount = tcurrency(payment.amount) return render_to_response(template_name, {'payment':payment}, context_instance=RequestContext(request))
def view(request, id=None, template_name="make_payments/view.html"): mp = get_object_or_404(MakePayment, pk=id) if not mp.allow_view_by(request.user): raise Http403 mp.payment_amount = tcurrency(mp.payment_amount) return render_to_response(template_name, {'mp':mp}, context_instance=RequestContext(request))
def format_currency(value): """format currency""" from base.utils import tcurrency return tcurrency(value)