Ejemplo n.º 1
0
 def get_context_data(self, **kwargs):
     kwargs = super().get_context_data(**kwargs)
     kwargs["can_pay"] = self.can_pay
     kwargs["backends"] = [x(self.object) for x in list_backends()]
     return kwargs
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.fields["method"].choices = [(backend.name, backend.verbose)
                                      for backend in list_backends()]