31 lines
777 B
Python
31 lines
777 B
Python
from rowers.models import Rower,PaidPlan
|
|
|
|
# run once - copies plans to paypal
|
|
def planstopaypal():
|
|
plans = PaidPlan.objects.all()
|
|
|
|
for plan in plans:
|
|
plan.pk = None
|
|
plan.paymentprocessor = 'paypal'
|
|
plan.external_id = None
|
|
plan.save()
|
|
|
|
def setrowerplans():
|
|
rowers = Rower.objects.all()
|
|
|
|
for r in rowers:
|
|
if r.rowerplan != 'basic':
|
|
paidplans = PaidPlan.objects.filter(
|
|
shortname = r.rowerplan,
|
|
paymenttype = r.paymenttype,
|
|
clubsize = r.clubsize)
|
|
|
|
if paidplans:
|
|
r.paidplan = paidplans[0]
|
|
r.paymenttype = 'paypal'
|
|
r.save()
|
|
else:
|
|
print 'Could not set plan for ',r
|
|
|
|
|