Hi all,
I am working on an application using Google application engine and Django. I am using app engine patch. Some of the models have ReferenceProperty fields.
The issue is that when I am deleting some entries of the Referenced model, it should delete the entries where this ReferenceProperty is being used following the foreign key kind of relation. But actually it is not happening. The field remains without the deleted field and which is causing an error message:
ReferenceProperty failed to be resolved
Following is an example of the model:
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)
When I am deleting some of the categories, the related topics should also be deleted. But the topics are not deleted and cause the "ReferenceProperty failed to be resolved error" message.
Please suggest.
Thanks in advance.