|
@@ -26,14 +26,23 @@ class CheckoutSessionMixin(object):
|
26
|
26
|
All checkout views subclass this mixin. It ensures that all relevant
|
27
|
27
|
checkout information is available in the template context.
|
28
|
28
|
"""
|
29
|
|
- # This should be list of method names that get executed before the normal
|
30
|
|
- # flow of the view. Each method should check some condition has been met.
|
31
|
|
- # If not, then an exception is raised that indicates the URL the customer
|
32
|
|
- # should be redirect to.
|
|
29
|
+
|
|
30
|
+ # A pre-condition is a condition that MUST be met in order for a view
|
|
31
|
+ # to be available. If it isn't then the customer should be redirected
|
|
32
|
+ # to a view *earlier* in the chain.
|
|
33
|
+ # pre_conditions is a list of method names that get executed before the
|
|
34
|
+ # normal flow of the view. Each method should check some condition has been
|
|
35
|
+ # met. If not, then an exception is raised that indicates the URL the
|
|
36
|
+ # customer will be redirected to.
|
|
37
|
+
|
33
|
38
|
pre_conditions = None
|
34
|
39
|
|
35
|
|
- # Skip conditions check whether the view should be skipped. They work in
|
36
|
|
- # the same way as pre-conditions.
|
|
40
|
+ # A *skip* condition is a condition that MUST NOT be met in order for a
|
|
41
|
+ # view to be available. If the condition is met, this means the view MUST
|
|
42
|
+ # be skipped and the customer should be redirected to a view *later* in
|
|
43
|
+ # the chain.
|
|
44
|
+ # Skip conditions work similar to pre-conditions, and get evaluated after
|
|
45
|
+ # pre-conditions have been evaluated.
|
37
|
46
|
skip_conditions = None
|
38
|
47
|
|
39
|
48
|
def dispatch(self, request, *args, **kwargs):
|