コード例 #1
0
ファイル: views.py プロジェクト: ondrejsika2/metrocar
 def get(self, request, data):
     bounds = data > maybe | X.get('in_polygon')
     return ((data or {}) > as_kwargs(get_car_position_data)
             | where(X['car'] | self.filter)
             | group_by(X['location'] | (grouping_precision, X, bounds))
             | X.iteritems()
             | foreach({
                 'location': X[1][0]['location'],
                 'cars': X[1] | foreach(X['car']) | self.get_car_data,
             })
             | tuple)
コード例 #2
0
ファイル: views.py プロジェクト: ondrejsika2/metrocar
 def get(self, request, data):
     bounds = data > maybe | X.get('in_polygon')
     return ((data or {}) > as_kwargs(get_car_position_data)
         | where(X['car'] | self.filter)
         | group_by(X['location'] | (grouping_precision, X, bounds))
         | X.iteritems()
         | foreach({
             'location': X[1][0]['location'],
             'cars': X[1] | foreach(X['car']) | self.get_car_data,
           })
         | tuple)
コード例 #3
0
ファイル: sparse_route.py プロジェクト: ondrejsika2/metrocar
def execute(backend, query, max_items=50, **kwargs):
    return (query(**kwargs)
        > group_by(X['unit_id'])
        | X.iteritems()
        | foreach([KEY, VALUE | prune_to(max_items)])
        | dict)
コード例 #4
0
def execute(backend, query, max_items=50, **kwargs):
    return (query(**kwargs) > group_by(X['unit_id'])
            | X.iteritems()
            | foreach([KEY, VALUE | prune_to(max_items)])
            | dict)