Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixes for Django 1.5 #8

Merged
merged 1 commit into from

2 participants

@radiosilence

Django 1.5 doesn't have the simple views, but a simple django.shortcuts.render drops in nicely.

@emesik emesik merged commit c50805b into emesik:master
@emesik
Owner

Merged in. Thanks a lot!
Mamona has got neglected a bit, but I will be using it in a large project soon, so there will be an opportunity to work on it.

@radiosilence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2013
  1. @radiosilence

    Fixing for Django 1.5

    radiosilence authored
This page is out of date. Refresh to see the latest.
View
5 mamona/backends/dummy/views.py
@@ -1,13 +1,12 @@
from django.http import HttpResponseRedirect
-from django.shortcuts import get_object_or_404
-from django.views.generic.simple import direct_to_template
+from django.shortcuts import get_object_or_404, render
from mamona.models import Payment
from models import DummyTxn
def decide_success_or_failure(request, payment_id):
payment = get_object_or_404(Payment, id=payment_id, status='in_progress', backend='dummy')
- return direct_to_template(
+ return render(
request,
'mamona/backends/dummy/decide.html',
{'payment': payment}
View
5 mamona/backends/paypal/views.py
@@ -1,6 +1,5 @@
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
-from django.shortcuts import get_object_or_404
-from django.views.generic.simple import direct_to_template
+from django.shortcuts import get_object_or_404, render
from django.views.decorators.csrf import csrf_exempt
from mamona.models import Payment
@@ -24,7 +23,7 @@ def return_from_gw(request, payment_id):
return HttpResponseRedirect(urls['partially_paid'])
except KeyError:
return HttpResponseRedirect(urls['paid'])
- return direct_to_template(
+ return render(
request,
'mamona/base_return.html',
{'payment': payment}
View
4 mamona/templates/mamona/backends/dummy/decide.html
@@ -9,7 +9,7 @@
{% trans "Would you like to finish this payment with success or failure?" %}
</p>
<p>
-<a href="{% url mamona-dummy-do-success payment.id %}">{% trans "Success" %}</a>
-<a href="{% url mamona-dummy-do-failure payment.id %}">{% trans "Failure" %}</a>
+<a href="{% url 'mamona-dummy-do-success' payment.id %}">{% trans "Success" %}</a>
+<a href="{% url 'mamona-dummy-do-failure' payment.id %}">{% trans "Failure" %}</a>
</p>
{% endblock %}
View
7 mamona/views.py
@@ -1,8 +1,7 @@
from django.conf import settings
from django.http import HttpResponseNotFound, HttpResponseRedirect
from django.core.urlresolvers import reverse
-from django.shortcuts import get_object_or_404
-from django.views.generic.simple import direct_to_template
+from django.shortcuts import get_object_or_404, render
from models import Payment, Order, payment_from_order
from forms import PaymentMethodForm
@@ -42,7 +41,7 @@ def process_payment(request, payment_id):
bknd_form.save()
return HttpResponseRedirect(
reverse('mamona-confirm-payment', kwargs={'payment_id': payment.id}))
- return direct_to_template(
+ return render(
request,
'mamona/select_payment_method.html',
{'payment': payment, 'form': bknd_form},
@@ -51,5 +50,5 @@ def process_payment(request, payment_id):
def confirm_payment(request, payment_id):
payment = get_object_or_404(Payment, id=payment_id, status='new')
formdata = payment.get_processor().get_confirmation_form(payment)
- return direct_to_template(request, 'mamona/confirm.html',
+ return render(request, 'mamona/confirm.html',
{'formdata': formdata, 'payment': payment})
Something went wrong with that request. Please try again.