c[f'{tag}_wide_spot'] = wide_spot
return c
+ def get_description_for_amount(self, amount, monthly):
+ amounts = self.monthlyamount_set if monthly else self.singleamount_set
+ amount = amounts.all().filter(amount__lte=amount).last()
+ return amount.description if amount is not None else ''
+
+ @property
+ def paypal_enabled(self):
+ print("ENABLED?", settings.PAYPAL_ENABLED)
+ return settings.PAYPAL_ENABLED
class SingleAmount(models.Model):
super(Schedule, self).save(*args, **kwargs)
self.update_contact()
+ def get_description(self):
+ club = Club.objects.first()
+ return club.get_description_for_amount(self.amount, self.monthly)
+
def initiate_payment(self, request):
return self.get_payment_method().initiate(request, self)