Skip to content

Commit

Permalink
add parent payment module to the view for easy access
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacrymology committed Feb 21, 2013
1 parent 8ef124b commit 1be7584
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions boilerplate/apps/store/modules/payment/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ class BaseRootView(views.PaymentDetailsView):
of single strings
* adds `preview_url` and `method_index_url` variables to the context
"""

def __init__(self, *args, **kwargs):
super(BaseRootView, self).__init__(*args, **kwargs)
self.app = import_shop_app('checkout', 'app').application

#: for internal usage. This is why boilerplate.apps.store.modules.payment.base.app.PaymentModule sets module=self in every view
module = None

def get_template_names(self):
"""
Expand All @@ -43,6 +40,9 @@ def get_template_names(self):
return [self.template_name]

def get_context_data(self, **kwargs):
ctx = {}
ctx.update(super(BaseRootView, self).get_context_data())
ctx = {
'preview_url': self.module.get_preview_url(),
'payment_module_root': self.module.get_root_url(),
}
ctx.update(super(BaseRootView, self).get_context_data(**kwargs))
return ctx

0 comments on commit 1be7584

Please sign in to comment.