I have a scenario in which I need a self reference property as follow:
class Post(db.Model):
creator = db.UserProperty()
post_title = db.StringProperty(required=True)
post_status = db.StringProperty(required=True, choices=['draft', 'published'])
post_parent = db.SelfReferenceProperty()
Now, I want ensure that an entity shouldn't be its own parent and a child of an entity cannot be its parent. How can I ensure this kind of a relationship in the PostForm model form and the Post model.