Query with paging by cursor causes error because of limitations for “IN filter” in cursor() method… What should be the alternative?

前端 未结 5 694
-上瘾入骨i
-上瘾入骨i 2020-12-20 02:15

I am developing a twitter like microblogging system by using the following models:

class Member(db.Model):    
    user = db.UserProperty(required=True)
             


        
5条回答
  •  旧巷少年郎
    2020-12-20 03:03

    Consider you have a member object named member_obj. From your model you can do something like this

    To get the list of followings,

    member_obj.followings will give you the list of keys , simply pass it to

    followings_keys = member_obj.followings
    Member.get(following_keys).
    

    Then just loop through the members and display their messages.. This post on Modeling in appengine will help you a lot.

提交回复
热议问题