Private
Public Access
1
0

very basic plannedsession view view

This commit is contained in:
Sander Roosendaal
2018-02-06 10:57:47 +01:00
parent c33d6cb5e5
commit da02466f8a
6 changed files with 72 additions and 1 deletions

View File

@@ -741,7 +741,7 @@ from utils import (
geo_distance,serialize_list,deserialize_list,uniqify,
str2bool,range_to_color_hex,absolute,myqueue,get_call,
calculate_age,rankingdistances,rankingdurations,
is_ranking_piece
is_ranking_piece,my_dict_from_instance
)
import datautils
@@ -11801,3 +11801,24 @@ def plannedsession_edit_view(request,id=0):
'plannedsessions':sps,
'thesession':ps,
})
def plannedsession_view(request,id=0):
r = getrower(request.user)
try:
ps = PlannedSession.objects.get(id=id)
except PlannedSession.DoesNotExist:
raise Http404("Planned Session does not exist")
psdict = {}
psdict = my_dict_from_instance(ps,PlannedSession)
return render(request,'plannedsessionview.html',
{
'psdict': psdict,
'attrs':['name','startdate']
}
)