开发者

SelfReferenceProperty question

I am trying to use google appengine. I have this model:

def Human(db.Model):
 name = db.StringProperty()
 friends = db.SelfReferenceProperty()

This Human has more than one friend. So, how开发者_JAVA百科 to handle this with google appengine?


For simple many-to-many relationships, use a ListProperty with a list of keys.

If you need to store additional metadata, give the model its own relationship, e.g. Friendship.

Examples of both can be found @ http://code.google.com/appengine/articles/modeling.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜