变化的问题。我想应用和之间的ManyToMany
关系。例子db.Model
NDB
NDB
模型
class my_NDB(search.SearchableModel):
.......
.......
db
模型
class Test(search.SearchableModel):
email = db.StringProperty()
created_by = db.IntegerProperty()
我可以应用ManyToMany
这些模型之间的关系吗?
编辑:
这是我的User
模型
class User(model.Expando):
"""Stores user authentication credentials or authorization ids."""
#: The model used to ensure uniqueness.
unique_model = Unique
#: The model used to store tokens.
token_model = UserToken
created = model.DateTimeProperty(auto_now_add=True)
updated = model.DateTimeProperty(auto_now=True)
# ID for third party authentication, e.g. 'google:username'. UNIQUE.
auth_ids = model.StringProperty(repeated=True)
# Hashed password. Not required because third party authentication
# doesn't use password.
email = model.StringProperty(required=True)
is_active = model.BooleanProperty(required=True)
password = model.StringProperty()
这是我的Test
db
模型
class Test(search.SearchableModel):
email = db.StringProperty()
created_by = db.IntegerProperty()
现在我想在测试中应用 manyToMany。是否可以?
Django 风格的多对多
created_by = models.ManyToManyField(User)