问题是,当我删除引用模型的一些条目时,它应该删除在外键类型的关系之后使用这个ReferenceProperty的条目。但事实上这并没有发生。字段仍保留,没有删除的字段,这将导致错误消息:
ReferenceProperty failed to be resolved
class Topic(db.Model):
title = db.StringProperty(required = True)
body = db.TextProperty(required = True)
category = db.ReferenceProperty(Category,required = True)
status = db.StringProperty(default="open")
creator = db.ReferenceProperty(User,required = True)
class Category(db.Model):
name = db.StringProperty(required = True)
creation_date = db.DateTimeProperty(auto_now_add=True)
creator = db.ReferenceProperty(User,required = True)
class Meta:
verbose_name = "Category"
verbose_name_plural = "Categories"
def __unicode__(self):
return '%s' % (self.name)
当我删除一些类别时,相关的主题也应该被删除。但主题未被删除,并导致“ReferenceProperty未能解析”错误消息。
请建议。