diff --git a/rowers/templates/developers.html b/rowers/templates/developers.html index ff0f01d0..3d966f82 100644 --- a/rowers/templates/developers.html +++ b/rowers/templates/developers.html @@ -8,7 +8,7 @@
  • -

    On this page, a work in progress, I will collect useful information +

    On this page, I will collect useful information for developers of rowing data apps and hardware.

    I presume you have an app (smartphone app, dedicated hardware, web site) @@ -61,11 +61,11 @@

Using the REST API

-

We are building a REST API which will allow you to post and +

We have a REST API which will allow you to post and receive stroke data from the site directly.

-

The REST API is a work in progress. We are open to improvement +

We are open to improvement suggestions (provided they don't break existing apps). Please send email to info@rowsandall.com with questions and/or suggestions. We @@ -84,7 +84,6 @@

  • Disadvantages

      -
    • The API is not stable and not fully tested yet.
    • You need to register your app with us. We can revoke your permissions if you misuse them.
    • The user user must grant permissions to your app.
    • @@ -114,7 +113,7 @@

      We have disabled the self service app link for security reasons. - We will replace it with a secure self service app link soon. If you + If you need to register an app, please send email to info@rowsandall.com

      Authentication

      @@ -728,11 +727,11 @@
    • peakdriveforce: Peak handle force (lbs)
    • lapidx: Lap identifier
    • hr: Heart rate (beats per minute)
    • -
    • wash: Wash as defined per Empower oarlock (degrees)
    • -
    • catch: Catch angle per Empower oarlock (degrees)
    • -
    • finish: Finish angle per Empower oarlock (degrees)
    • -
    • peakforceangle: Peak Force Angle per Empower oarlock (degrees)
    • -
    • slip: Slip as defined per Empower oarlock (degrees)
    • +
    • wash: Wash as defined for your smart power measuring oarlock (degrees)
    • +
    • catch: Catch angle for your smart power measuring oarlock (degrees)
    • +
    • finish: Finish angle for your smart power measuring oarlock (degrees)
    • +
    • peakforceangle: Peak Force Angle for your smart power measuring oarlock (degrees)
    • +
    • slip: Slip as defined for your smart power measuring oarlock (degrees)

    diff --git a/rowers/tests/test_api.py b/rowers/tests/test_api.py index 8bd91a55..649bca2f 100644 --- a/rowers/tests/test_api.py +++ b/rowers/tests/test_api.py @@ -471,6 +471,14 @@ class OwnApi(TestCase): gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), rowerplan='pro',subscription_id=1) + self.c = Client() + self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) + self.factory = RequestFactory() + self.password = faker.word() + self.u.set_password(self.password) + self.u.save() + + self.factory = APIRequestFactory() def test_strokedataform(self): diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index a12f9e93..c460bd6f 100644 Binary files a/rowers/tests/testdata/testdata.tcx.gz and b/rowers/tests/testdata/testdata.tcx.gz differ diff --git a/rowers/views/analysisviews.py b/rowers/views/analysisviews.py index c11ef6c0..d9fcb8e1 100644 --- a/rowers/views/analysisviews.py +++ b/rowers/views/analysisviews.py @@ -363,7 +363,10 @@ def trendflexdata(workouts, options, userid=0): savedata = options.get('savedata',False) - workouts = workouts.exclude(workoutsource='strava') + try: + workouts = workouts.exclude(workoutsource='strava') + except AttributeError: # pragma: no cover + workouts = [w for w in workouts if w.workoutsource != 'strava'] fieldlist, fielddict = dataprep.getstatsfields() fieldlist = [xparam, yparam, groupby, @@ -567,7 +570,10 @@ def flexalldata(workouts, options): trendline = options['trendline'] promember = True - workouts = workouts.exclude(workoutsource='strava') + try: + workouts = workouts.exclude(workoutsource='strava') + except AttributeError: # pragma: no cover + workouts = [w for w in workouts if w.workoutsource != 'strava'] workstrokesonly = not includereststrokes @@ -615,7 +621,10 @@ def histodata(workouts, options): workmax = options['workmax'] userid = options['userid'] - workouts = workouts.exclude(workoutsource='strava') + try: + workouts = workouts.exclude(workoutsource='strava') + except AttributeError: # pragma: no cover + workouts = [w for w in workouts if w.workoutsource != 'strava'] if userid == 0: # pragma: no cover @@ -805,7 +814,10 @@ def cpdata(workouts, options): def statsdata(workouts, options): - workouts = workouts.exclude(workoutsource='strava') + try: + workouts = workouts.exclude(workoutsource='strava') + except AttributeError: # pragma: no cover + workouts = [w for w in workouts if w.workoutsource != 'strava'] includereststrokes = options['includereststrokes'] ids = options['ids'] @@ -881,7 +893,11 @@ def statsdata(workouts, options): def comparisondata(workouts, options): - workouts = workouts.exclude(workoutsource='strava') + try: + workouts = workouts.exclude(workoutsource='strava') + except AttributeError: # pragma: no cover + workouts = [w for w in workouts if w.workoutsource != 'strava'] + includereststrokes = options['includereststrokes'] xparam = options['xaxis'] yparam1 = options['yaxis1'] @@ -925,7 +941,10 @@ def comparisondata(workouts, options): def boxplotdata(workouts, options): - workouts = workouts.exclude(workoutsource='strava') + try: + workouts = workouts.exclude(workoutsource='strava') + except AttributeError: + workouts = [w for w in workouts if w.workoutsource != 'strava'] includereststrokes = options['includereststrokes'] spmmin = options['spmmin']