Exemplo n.º 1
0
 def obj_get_list(self, request=None, **kwargs):
     symbol = 'symbol_{0}'.format(kwargs.get('symbol').upper())
     redis = RedisDB()
     json = '[{0}]'.format(','.join(redis.lrange(symbol, 0, 1000)))
     
     quote_type = request.GET.get('type', 'ask')
     objs = [Quote(quote_type, **x) for x in simplejson.loads(json)]
     return objs
Exemplo n.º 2
0
    def obj_get_list(self, request=None, **kwargs):
        symbol = 'symbol_{0}'.format(kwargs.get('symbol').upper())
        redis = RedisDB()
        json = '[{0}]'.format(','.join(redis.lrange(symbol, 0, 1000)))

        quote_type = request.GET.get('type', 'ask')
        objs = [Quote(quote_type, **x) for x in simplejson.loads(json)]
        return objs
Exemplo n.º 3
0
 def obj_get_list(self, request=None, **kwargs):
     # Rewrite some kwargs..
     redis = RedisDB()
     symbols = [x for x in redis.smembers('symbols')]
     return [Symbol(x) for x in symbols]
Exemplo n.º 4
0
 def obj_get_list(self, request=None, **kwargs):
     # Rewrite some kwargs..
     redis = RedisDB()
     symbols = [x for x in redis.smembers('symbols')]
     return [  Symbol(x) for x in symbols]