sqlalchemy_utils.types.UUIDType

Here are the examples of the python api sqlalchemy_utils.types.UUIDType taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: coaster Source File: sqlalchemy.py
Function: id
    @declared_attr
    def id(cls):
        """
        Database identity for this model, used for foreign key references from other models
        """
        if cls.__uuid_primary_key__:
            return Column(UUIDType(binary=False), default=uuid1mc, primary_key=True)
        else:
            return Column(Integer, primary_key=True)

Example 2

Project: hasjob Source File: 57da2d78c9ca_use_uuid_key_for_event_sessions.py
Function: upgrade
def upgrade():
    op.add_column('event_session', sa.Column('uuid', sqlalchemy_utils.types.UUIDType(binary=False), nullable=True))
    op.create_unique_constraint('event_session_uuid_key', 'event_session', ['uuid'])