Source code for sqlalchemy_tree.types

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    sqlalchemy_tree.types
    ~~~~~~~~~~~~~~~~~~~~~

    :copyright: (C) 2012-2014 the SQLAlchemy-ORM-Tree authors and contributors
                <see AUTHORS file>.
    :license: BSD, see LICENSE for more details.
"""

from __future__ import absolute_import, division, print_function, \
    with_statement, unicode_literals

import sqlalchemy

__all__ = (
    'TreeIdType',
    'TreeEndpointType',
    'TreeLeftType',
    'TreeRightType',
    'TreeDepthType',
)


[docs]class TreeIntegerType(sqlalchemy.types.TypeDecorator): "Abstract base class implementing an integer type." impl = sqlalchemy.Integer
[docs]class TreeIdType(TreeIntegerType): "Integer field subtype representing an node's tree identifier." pass
[docs]class TreeEndpointType(TreeIntegerType): """Abstract base class of an integer implementing either a “left” or “right” field of a node.""" pass
[docs]class TreeLeftType(TreeEndpointType): "Integer field subtype representing an node's “left” field." pass
[docs]class TreeRightType(TreeEndpointType): "Integer field subtype representing an node's “right” level." pass
[docs]class TreeDepthType(TreeIntegerType): "Integer field subtype representing an node's depth level." pass