Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
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)
Exemplo n.º 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)