create plannedsession view v1.0
This commit is contained in:
@@ -17,7 +17,7 @@ queuehigh = django_rq.get_queue('low')
|
||||
from rowers.models import (
|
||||
Rower, Workout,
|
||||
GeoCourse, TrainingMicroCycle,TrainingMesoCycle,TrainingMacroCycle,
|
||||
TrainingPlan,
|
||||
TrainingPlan,PlannedSession,
|
||||
)
|
||||
|
||||
import metrics
|
||||
@@ -103,3 +103,13 @@ def remove_rower_session(r,ps):
|
||||
ps.rower.remove(r)
|
||||
|
||||
return 1
|
||||
|
||||
def get_sessions(r,startdate=timezone.now(),
|
||||
enddate=timezone.now()+timezone.timedelta(+1000)):
|
||||
sps = PlannedSession.objects.filter(
|
||||
rower__in=[r],
|
||||
startdate__gte=startdate,
|
||||
enddate__lte=enddate,
|
||||
).order_by("startdate")
|
||||
|
||||
return sps
|
||||
|
||||
Reference in New Issue
Block a user