operator method outputResultsJSON now returns the completion times together...

operator method outputResultsJSON now returns the completion times together with the start times (schedule)
parent 36884db7
...@@ -336,7 +336,17 @@ class Operator(ObjectResource): ...@@ -336,7 +336,17 @@ class Operator(ObjectResource):
if self.schedule: if self.schedule:
json['results']['schedule']=[] json['results']['schedule']=[]
for record in self.schedule: for record in self.schedule:
json['results']['schedule'].append({'stationId':record[0].id,'entranceTime':record[1]}) print record
print "the length of the operator schedule is ", len(record)
if len(record)==3:
json['results']['schedule'].append({
'stationId':record[0].id,
'entranceTime':record[1],
'exitTime':record[2]})
else:
json['results']['schedule'].append({
'stationId':record[0].id,
'entranceTime':record[1]})
G.outputJSON['elementList'].append(json) G.outputJSON['elementList'].append(json)
#=========================================================================== #===========================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment