Added other info about tz module.

This commit is contained in:
Daniele Varrazzo 2010-02-13 03:22:02 +00:00 committed by Federico Di Gregorio
parent 6a4ff65b49
commit 3789f8fb17
3 changed files with 16 additions and 5 deletions

View File

@ -482,3 +482,12 @@ The ``cursor`` class
.. versionadded:: 2.0.6
.. attribute:: tzinfo_factory
The time zone factory used to handle data types such as
:sql:`TIMESTAMP WITH TIME ZONE`. It should be a |tzinfo|_ object.
See also the :mod:`psycopg2.tz` module.
.. |tzinfo| replace:: :class:`!tzinfo`
.. _tzinfo: http://docs.python.org/library/datetime.html#tzinfo-objects

View File

@ -6,11 +6,11 @@
.. module:: psycopg2.tz
This module holds two different tzinfo implementations that can be used as the
:obj:`tzinfo` argument to datetime constructors, directly passed to psycopg
:obj:`tzinfo` argument to datetime constructors, directly passed to Psycopg
functions or used to set the :attr:`cursor.tzinfo_factory` attribute in
cursors.
.. todo:: tz module
.. todo:: should say something more about tz handling
.. autoclass:: psycopg2.tz.FixedOffsetTimezone

View File

@ -34,9 +34,11 @@ ZERO = datetime.timedelta(0)
class FixedOffsetTimezone(datetime.tzinfo):
"""Fixed offset in minutes east from UTC.
This is exactly the implementation found in Python 2.3.x documentation,
with a small change to the __init__ method to allow for pickling and a
default name in the form 'sHH:MM' ('s' is the sign.)
This is exactly the implementation__ found in Python 2.3.x documentation,
with a small change to the :meth:`!__init__` method to allow for pickling
and a default name in the form ``sHH:MM`` (``s`` is the sign.).
.. __: http://docs.python.org/library/datetime.html#datetime-tzinfo
"""
_name = None
_offset = ZERO