Added docs for JSONType, bumped version

This commit is contained in:
Konsta Vesterinen
2013-10-24 17:40:51 +03:00
parent cb25a29239
commit cb0b59ba8c
3 changed files with 34 additions and 1 deletions

View File

@@ -4,6 +4,12 @@ Changelog
Here you can see the full list of changes between each SQLAlchemy-Utils release. Here you can see the full list of changes between each SQLAlchemy-Utils release.
0.20.0 (2013-10-24)
^^^^^^^^^^^^^^^^^^^
- Added JSONType
0.19.0 (2013-10-24) 0.19.0 (2013-10-24)
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^

View File

@@ -144,6 +144,33 @@ Querying the database returns Color objects:
For more information about colour package and Color object, see https://github.com/vaab/colour For more information about colour package and Color object, see https://github.com/vaab/colour
JSONType
^^^^^^^^
JSONType offers way of saving JSON data structures to database. On PostgreSQL the underlying implementation of this data type is 'json' while on other databases its simply 'text'.
::
from sqlalchemy_utils import JSONType
class Product(Base):
__tablename__ = 'product'
id = sa.Column(sa.Integer, autoincrement=True)
name = sa.Column(sa.Unicode(50))
details = sa.Column(JSONType)
product = Product()
product.details = {
'color': 'red',
'type': 'car',
'max-speed': '400 mph'
}
session.commit()
LocaleType LocaleType
^^^^^^^^^^ ^^^^^^^^^^

View File

@@ -45,7 +45,7 @@ from .types import (
) )
__version__ = '0.19.0' __version__ = '0.20.0'
__all__ = ( __all__ = (