开发者

Google App Engine many-to-many to self

开发者 https://www.devze.com 2023-01-15 04:30 出处:网络
I\'m trying to convert a django project for GAE, and I\'ve stumble开发者_C百科d upon this: (relational-databse)

I'm trying to convert a django project for GAE, and I've stumble开发者_C百科d upon this:

(relational-databse)

class Clan(models.Model):
    wars = models.ManyToManyField('self')

How can I do this in a non-relational database(i.e. gae datastore)?


If you don't expect more than, say, a couple of hundred keys in the list of related entities, you could use a db.ListProperty(db.Key), containing the keys of the referenced entities.

0

精彩评论

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