擅长:python、mysql、java
<p>您可能无法从ORM中获取所需的格式。但是,您可以高效地执行以下操作:</p>
<pre><code>c_layer_points = models.layer_points.objects.filter(location_id=c_location.pk, season_id=c_season.pk, line_path_id=c_line_path.pk,radar_id=c_radar.pk, layer_id__in=c_layer_pks, gps_time__gte=start_gps, gps_time__lte=stop_gps).values_list('gps_time', 'twtt')
</code></pre>
<p>现在把元组分成两个列表:(元组解包)</p>
<pre><code>split_lst = zip(*c_layer_points)
dict(gps_time=list(split_lst[0]), twtt=list(split_lst[1]))
</code></pre>