开发者

Why does this instruction not work?

开发者 https://www.devze.com 2023-03-07 10:57 出处:网络
Hi I\'m trying to count using keys only and get an error message when using this line self.response.out.write(A.all(keys_only=True).count(100000000))

Hi I'm trying to count using keys only and get an error message when using this line self.response.out.write(A.all(keys_only=True).count(100000000))

The error message I get is TypeError: all() got an unexpected keyword argument 'keys_only'

Isn't it supposed to work this way? What am I doing wrong? Thanks `

UPDATE: I 开发者_开发百科found this way worked:

    query = A.all()
    query._keys_only = True        
    self.response.out.write(query.count(100000000))


There is problem with SearchableModel and keys_only. you can do some think like this.

query = A.all()
query._keys_only = True 
0

精彩评论

暂无评论...
验证码 换一张
取 消