simple upgrade/billing address form
This commit is contained in:
@@ -2,7 +2,8 @@ from django import forms
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
from rowers.models import (
|
||||
Workout,Rower,Team,PlannedSession,GeoCourse,
|
||||
VirtualRace,VirtualRaceResult,IndoorVirtualRaceResult
|
||||
VirtualRace,VirtualRaceResult,IndoorVirtualRaceResult,
|
||||
PaidPlan
|
||||
)
|
||||
from rowers.rows import validate_file_extension,must_be_csv,validate_image_extension,validate_kml
|
||||
from django.contrib.auth.forms import UserCreationForm
|
||||
@@ -712,7 +713,19 @@ class StatsOptionsForm(forms.Form):
|
||||
for type in mytypes.checktypes:
|
||||
self.fields[type] = forms.BooleanField(initial=True,required=False)
|
||||
|
||||
class PlanSelectForm(forms.Form):
|
||||
plan = forms.ModelChoiceField(queryset=PaidPlan.objects.all(),
|
||||
widget=forms.RadioSelect,required=True)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
paymentprocessor = kwargs.pop('paymentprocessor',None)
|
||||
super(PlanSelectForm, self).__init__(*args, **kwargs)
|
||||
self.fields['plan'].empty_label = None
|
||||
if paymentprocessor:
|
||||
self.fields['plan'].queryset = PaidPlan.objects.filter(
|
||||
paymentprocessor=paymentprocessor
|
||||
).exclude(shortname="basic").order_by("price","clubsize","shortname")
|
||||
|
||||
class CourseSelectForm(forms.Form):
|
||||
course = forms.ModelChoiceField(queryset=GeoCourse.objects.all())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user