Created
June 30, 2011 01:41
-
-
Save mbrochh/1055461 to your computer and use it in GitHub Desktop.
SkipShippingBackend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Shipping backend that skips the whole shipping process.""" | |
from django.conf.urls.defaults import patterns, url | |
class SkipShippingBackend(object): | |
backend_name = "Skip Shipping Backend" | |
url_namespace = "skip-shipping" | |
def __init__(self, shop): | |
self.shop = shop | |
def simple_view(self, request): | |
""" | |
This simple view does nothing but forward to the final URL. When the | |
money is sent, the shop owner can set this order to complete manually. | |
""" | |
order = self.shop.get_order(request) | |
return self.shop.finished(order) | |
def get_urls(self): | |
urlpatterns = patterns('', | |
url(r'^$', self.simple_view, name='skip-shipping' ), | |
) | |
return urlpatterns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment