You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
529 B

from course_service.maps.models import CourseRoute
class OutApiRoute:
@staticmethod
def change_id(id: int) -> str:
return CourseRoute.objects.get(id=id).out_key
@staticmethod
def get_route_matrix(out_key):
map_list = [i.map_course for i in CourseRoute.objects.get(out_key=out_key).pivotcoursemap_set.all()]
return [[j.vertex.token for j in i.pivotvertex_set.all()] for i in map_list]
@staticmethod
def get_route(out_key):
return CourseRoute.objects.get(out_key=out_key)