From bfe1ec97ffd593035ddf616a9689fe5f5748d406 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Mon, 15 Jul 2013 12:00:59 -0700 Subject: [PATCH] Add documentation blurb for UUIDType. --- docs/index.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index a7584bf..495ee72 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -173,6 +173,24 @@ NumberRange supports some arithmetic operators: # '30-140' +UUIDType +-------- + +UUIDType will store a UUID in the database in a native format, if available, +or a 16-byte BINARY column or a 32-character CHAR column if not. + +:: + + from sqlalchemy_utils import UUIDType + import uuid + + class User(Base): + __tablename__ = 'user' + + # Pass `binary=False` to fallback to CHAR instead of BINARY + id = sa.Column(UUIDType(binary=False), primary_key=True) + + API Documentation -----------------