diff --git a/rowers/dataprep.py b/rowers/dataprep.py index eeaa2b64..ba78268e 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -95,6 +95,15 @@ from scipy.signal import savgol_filter import datetime +def get_workouts(ids,userid): + goodids = [] + for id in ids: + w = Workout.objects.get(id=id) + if int(w.user.user.id) == int(userid): + goodids.append(id) + + return [Workout.objects.get(id=id) for id in goodids] + def filter_df(datadf,fieldname,value,largerthan=True): try: diff --git a/rowers/dataprepnodjango.py b/rowers/dataprepnodjango.py index 8872d4e7..af17d87a 100644 --- a/rowers/dataprepnodjango.py +++ b/rowers/dataprepnodjango.py @@ -18,6 +18,7 @@ from rowsandall_app.settings import DATABASES from utils import lbstoN + user = DATABASES['default']['USER'] password = DATABASES['default']['PASSWORD'] database_name = DATABASES['default']['NAME'] @@ -335,6 +336,7 @@ def handle_nonpainsled(f2,fileformat,summary=''): return (f2,summary,oarlength,inboard) + # Create new workout from file and store it in the database # This routine should be used everywhere in views.py and mailprocessing.py # Currently there is code duplication diff --git a/rowers/management/commands/getexpired.py b/rowers/management/commands/getexpired.py index b5b24e41..e6f68fc0 100644 --- a/rowers/management/commands/getexpired.py +++ b/rowers/management/commands/getexpired.py @@ -22,6 +22,9 @@ def getexpired(): if r.planexpires < datetime.datetime.now().date(): if r.rowerplan == 'pro' or r.rowerplan == 'coach': lijst.append(r) + if r.teamplanexpires < datetime.datetime.now().date(): + if r.rowerplan == 'pro' or r.rowerplan == 'coach': + lijst.append(r) return lijst diff --git a/rowers/models.py b/rowers/models.py index fa0c839d..528c28b9 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -173,13 +173,14 @@ class Rower(models.Model): # Power Zone Data ftp = models.IntegerField(default=226,verbose_name="Functional Threshold Power") + otwslack = models.IntegerField(default=0,verbose_name="OTW Power slack") pw_ut2 = models.IntegerField(default=124,verbose_name="UT2 Power") pw_ut1 = models.IntegerField(default=171,verbose_name="UT1 Power") pw_at = models.IntegerField(default=203,verbose_name="AT Power") pw_tr = models.IntegerField(default=237,verbose_name="TR Power") pw_an = models.IntegerField(default=273,verbose_name="AN Power") - + powerzones = PowerZonesField(default=['Rest', 'Pwr UT2', 'Pwr UT1', @@ -576,7 +577,7 @@ class AdvancedWorkoutForm(ModelForm): class RowerPowerForm(ModelForm): class Meta: model = Rower - fields = ['ftp'] + fields = ['ftp','otwslack'] # Form to set rower's Power zones, including test routines # to enable consistency diff --git a/rowers/templates/about_us.html b/rowers/templates/about_us.html index b89f6881..5defb350 100644 --- a/rowers/templates/about_us.html +++ b/rowers/templates/about_us.html @@ -123,12 +123,10 @@ of a rowers technique.
Click on the PayPal button to pay for your Premium membership. - It will be valid for one year with automatic renewal which you can stop at any time. + Before you pay, please register for the free Basic membership and log in. + In this way, your user name will be added to the payment details. + Your payment will be valid for one year with automatic renewal which you can stop at any time. You will be taken to the secure PayPal payment site. -
After you do the payment, we will manually change your membership to "Pro". Depending on our availability, this may take some time @@ -138,6 +136,10 @@ You will be taken to the secure PayPal payment site.
diff --git a/rowers/templates/c2_list_import2.html b/rowers/templates/c2_list_import2.html index 03f2d8e7..886542be 100644 --- a/rowers/templates/c2_list_import2.html +++ b/rowers/templates/c2_list_import2.html @@ -6,36 +6,50 @@ {% block content %}| Import | -Date/Time | -Duration | -Total Distance | -Type | -Source | -Comment | -
|---|---|---|---|---|---|---|
| -Import | -{{ workout|lookup:'starttime' }} | -{{ workout|lookup:'duration' }} | -{{ workout|lookup:'distance' }} | -{{ workout|lookup:'rowtype' }} | -{{ workout|lookup:'source' }} | -{{ workout|lookup:'comment' }} | -
No workouts found
- {% endif %} + +{% if workouts %} +This imports all workouts that have not been imported to rowsandall.com. + The action may take a longer time to process, so please be patient. Click on Import in the list below to import an individual workout. +
+| Import | +Date/Time | +Duration | +Total Distance | +Type | +Source | +Comment | +New | +
|---|---|---|---|---|---|---|---|
| + Import | +{{ workout|lookup:'starttime' }} | +{{ workout|lookup:'duration' }} | +{{ workout|lookup:'distance' }} | +{{ workout|lookup:'rowtype' }} | +{{ workout|lookup:'source' }} | +{{ workout|lookup:'comment' }} | +{{ workout|lookup:'new' }} | +
No workouts found
+{% endif %} {% endblock %} diff --git a/rowers/templates/paypaltest.html b/rowers/templates/paypaltest.html new file mode 100644 index 00000000..2183fdcf --- /dev/null +++ b/rowers/templates/paypaltest.html @@ -0,0 +1,55 @@ + + {% extends "base.html" %} + {% block title %}About us{% endblock title %} + {% block content %} +This is a test page for testing the paypal functionality. Do not use it.
+ +Donations are welcome to keep this web site going. To help cover the hosting
+costs, I have created a Pro
membership option (for only 15 EURO per year). Once I process your
+donation, I will give you access to some special
features on this
+website.
Currently, the Pro membership will give you the following extra functionality (and more will follow): +
Click on the PayPal button to pay for your Pro membership. Before you pay, please register for the free Basic membership and log in. + In this way, your user name will be added to the payment details. +Your payment will be valid for one year with automatic renewal which you can stop at any time. +You will be taken to the secure PayPal payment site. +
+After you do the payment, we will manually change your membership to + "Pro". Depending on our availability, this may take some time + (typically one working day). Don't hesitate to contact us + if you have any questions at this stage.
+ +If, for any reason, you are not happy with your Pro membership, please let me know through the contact form. I will contact you as soon as possible to discuss how we can make things better.
+ +Click on the PayPal button to pay for your Pro membership. It will be valid for one year with automatic renewal which you can stop at any time. +
Click on the PayPal button to pay for your Pro membership. Before you pay, please register for the free Basic membership and log in. + In this way, your user name will be added to the payment details. +Your payment will be valid for one year with automatic renewal which you can stop at any time. You will be taken to the secure PayPal payment site. -
Set your heart rate zones with this form.
{% if form.errors %}Please correct the error{{ form.errors|pluralize }} below. @@ -27,6 +28,8 @@
The power zones are defined relative to power as measured by the + indoor rower.
-
Use this form to quickly change your zones based on the power of a recent - full out 60 minutes effort. It will update all zones defined above.
+ full out 60 minutes effort on the ergometer. + It will update all zones defined above. +The OTW Power Slack is the percentage drop of your On-the-water + rowing power + vs the erg power. Typical values are around 15%. This will lower + the power zones for your OTW workouts.