Commit 83934674 authored by sim's avatar sim

Add explicit DocumentNode definition

parent 3ffad0ed
...@@ -6,7 +6,9 @@ from .base import Base, Column, ForeignKey, relationship, TypeDecorator, Index, ...@@ -6,7 +6,9 @@ from .base import Base, Column, ForeignKey, relationship, TypeDecorator, Index,
flag_modified flag_modified
from .users import User from .users import User
__all__ = ['Node', 'NodeNode', 'CorpusNode']
__all__ = ['Node', 'NodeNode', 'CorpusNode', 'DocumentNode']
class NodeType(TypeDecorator): class NodeType(TypeDecorator):
"""Define a new type of column to describe a Node's type. """Define a new type of column to describe a Node's type.
...@@ -124,6 +126,10 @@ class Node(ValidatorMixin, Base): ...@@ -124,6 +126,10 @@ class Node(ValidatorMixin, Base):
flag_modified(self, 'hyperdata') flag_modified(self, 'hyperdata')
class DocumentNode(Node):
__mapper_args__ = {
'polymorphic_identity': 'DOCUMENT'
}
class CorpusNode(Node): class CorpusNode(Node):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment