From ba98e21a8843678023b7b4eae0f1f1c153f98389 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 26 Jul 2013 01:16:17 -0700 Subject: [PATCH] Add a blurb of documentation for TimezoneType. --- docs/index.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index fd69e30..efe5d16 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -191,6 +191,24 @@ or a 16-byte BINARY column or a 32-character CHAR column if not. id = sa.Column(UUIDType(binary=False), primary_key=True) +TimezoneType +------------ + +TimezoneType provides a way for saving timezones (from either the pytz or the dateutil package) objects into database. +TimezoneType saves timezone objects as strings on the way in and converts them back to objects when querying the database. + + +:: + + from sqlalchemy_utils import UUIDType + + class User(Base): + __tablename__ = 'user' + + # Pass backend='pytz' to change it to use pytz (dateutil by default) + timezone = sa.Column(TimezoneType(backend='pytz')) + + API Documentation -----------------