示例#1
0
 def get(self,
         simulation_id,
         time_range=None,
         stellar_type=None,
         popular_type=None):
     """
     Return preview data
     """
     data = SimulationPreview.query.filter(
         Simulation.id == simulation_id).one()
     return format_response(preview_list, data)
示例#2
0
 def get(self, id):
     """
     Returns detail of one simulation.
     """
     basic_info = Simulation.query.filter(Simulation.id == id).one()
     basic_info = format_model_result(simulation_detail, basic_info)
     basic_info['video_path'] = os.path.join(settings.RESOURCE_PATH,
                                             basic_info['video_path'])
     # files_info = session.execute("select * from simulation_files")
     # basic_info['files'] = format_sql_result(files_info)
     files_info = SimulationFiles.query.filter(
         SimulationFiles.simulation_id == id).order_by(
             SimulationFiles.time_range).all()
     basic_info['files'] = format_model_result(file_list, files_info)
     return format_response(simulation_detail, basic_info)
示例#3
0
 def get(self):
     """
     Returns list of simulations.
     """
     datalist = Simulation.query.all()
     return format_response(simulation_list, datalist)