Index and deletion for generic nodes

This commit is contained in:
2015-02-03 01:04:58 +01:00
parent 74dbe65834
commit 2ac2917645
6 changed files with 83 additions and 4 deletions

View File

@@ -57,7 +57,8 @@ class Node(db.Model):
node_type_id = db.Column(db.Integer(), db.ForeignKey(NodeType.id))
node_type = db.relationship(NodeType, backref='Node')
properties = db.relationship('NodeProperties', backref='Node')
properties = db.relationship('NodeProperties', backref='Node',
cascade="all, delete, delete-orphan")
def get_property(self, name):
for p in self.properties: