Merge branch 'develop' into feature/mapcompare
This commit is contained in:
@@ -24,6 +24,22 @@ queuehigh = django_rq.get_queue('low')
|
|||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
|
from rowingdata import rowingdata as rrdata
|
||||||
|
from rowingdata import rower as rrower
|
||||||
|
|
||||||
|
# Wrapper around the rowingdata call to catch some exceptions
|
||||||
|
# Checks for CSV file, then for gzipped CSV file, and if all fails, returns 0
|
||||||
|
def rdata(file,rower=rrower()):
|
||||||
|
try:
|
||||||
|
res = rrdata(csvfile=file,rower=rower)
|
||||||
|
except (IOError, IndexError, EOFError,FileNotFoundError):
|
||||||
|
try:
|
||||||
|
res = rrdata(csvfile=file+'.gz',rower=rower)
|
||||||
|
except (IOError, IndexError, EOFError,FileNotFoundError):
|
||||||
|
res = 0
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
from rowers.models import (
|
from rowers.models import (
|
||||||
Rower, Workout,Team,
|
Rower, Workout,Team,
|
||||||
GeoCourse, TrainingMicroCycle,TrainingMesoCycle,TrainingMacroCycle,
|
GeoCourse, TrainingMicroCycle,TrainingMesoCycle,TrainingMacroCycle,
|
||||||
@@ -1531,6 +1547,14 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
|
|||||||
|
|
||||||
# start adding sessions
|
# start adding sessions
|
||||||
if ws[0].startdatetime>=startdatetime and ws[0].startdatetime<=enddatetime:
|
if ws[0].startdatetime>=startdatetime and ws[0].startdatetime<=enddatetime:
|
||||||
|
# convert to gps
|
||||||
|
row = rdata(ws[0].csvfilename)
|
||||||
|
success = row.use_gpsdata()
|
||||||
|
if success:
|
||||||
|
row.write_csv(ws[0].csvfilename)
|
||||||
|
dataprep.update_strokedata(ws[0].id,row.df)
|
||||||
|
ws[0].impeller = False
|
||||||
|
|
||||||
ws[0].plannedsession = race
|
ws[0].plannedsession = race
|
||||||
ws[0].save()
|
ws[0].save()
|
||||||
result += 1
|
result += 1
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from django.conf import settings
|
|||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from rowsandall_app.views import rootview, landingview
|
from rowsandall_app.views import rootview, landingview, logoview
|
||||||
from django.contrib.auth import views as auth_views
|
from django.contrib.auth import views as auth_views
|
||||||
from rowers import views as rowersviews
|
from rowers import views as rowersviews
|
||||||
from survey import views as surveyviews
|
from survey import views as surveyviews
|
||||||
@@ -79,6 +79,7 @@ urlpatterns += [
|
|||||||
re_path(r'^twitter\_callback',rowersviews.rower_process_twittercallback),
|
re_path(r'^twitter\_callback',rowersviews.rower_process_twittercallback),
|
||||||
re_path(r'^i18n/', include('django.conf.urls.i18n')),
|
re_path(r'^i18n/', include('django.conf.urls.i18n')),
|
||||||
re_path(r'^tz_detect/', include('tz_detect.urls')),
|
re_path(r'^tz_detect/', include('tz_detect.urls')),
|
||||||
|
re_path(r'^logo/',logoview),
|
||||||
path('django-rq/', include('django_rq.urls')),
|
path('django-rq/', include('django_rq.urls')),
|
||||||
# path('500/', rowersviews.error500_view),
|
# path('500/', rowersviews.error500_view),
|
||||||
# re_path(r'^jsi18n/', django.views.i18n.javascript_catalog,name='jsi18n'),
|
# re_path(r'^jsi18n/', django.views.i18n.javascript_catalog,name='jsi18n'),
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ def landingview(request):
|
|||||||
return render(request,
|
return render(request,
|
||||||
'landingpage.html',
|
'landingpage.html',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def logoview(request):
|
||||||
|
image_data = open(settings.STATIC_ROOT+"/img/apple-icon-144x144.png", "rb").read()
|
||||||
|
return HttpResponse(image_data, content_type="image/png")
|
||||||
|
|
||||||
|
|
||||||
def rootview(request):
|
def rootview(request):
|
||||||
magicsentence = rmain()
|
magicsentence = rmain()
|
||||||
@@ -62,9 +66,9 @@ def rootview(request):
|
|||||||
'image':'/static/img/Remote coaching.png',
|
'image':'/static/img/Remote coaching.png',
|
||||||
'text':'Rowsandall.com is the ideal platform for remote rowing coaching. As a coach, you can easily manage your athletes, set up plans and monitor execution and technique'
|
'text':'Rowsandall.com is the ideal platform for remote rowing coaching. As a coach, you can easily manage your athletes, set up plans and monitor execution and technique'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
allofferings = [
|
allofferings = [
|
||||||
planoffering,
|
planoffering,
|
||||||
uploadoffering,
|
uploadoffering,
|
||||||
@@ -79,7 +83,7 @@ def rootview(request):
|
|||||||
random.shuffle(aux)
|
random.shuffle(aux)
|
||||||
|
|
||||||
offerings = aux[0:5]
|
offerings = aux[0:5]
|
||||||
|
|
||||||
return render(request,
|
return render(request,
|
||||||
'frontpage.html',
|
'frontpage.html',
|
||||||
{
|
{
|
||||||
@@ -87,6 +91,3 @@ def rootview(request):
|
|||||||
'form':loginform,
|
'form':loginform,
|
||||||
'offerings':offerings,
|
'offerings':offerings,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user