https://github.com/runfalk/stormspans
PostgreSQL range type support for Canonical's Storm ORM using Spans
https://github.com/runfalk/stormspans
Last synced: about 1 month ago
JSON representation
PostgreSQL range type support for Canonical's Storm ORM using Spans
- Host: GitHub
- URL: https://github.com/runfalk/stormspans
- Owner: runfalk
- License: mit
- Created: 2014-06-12T15:53:42.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T12:31:59.000Z (over 7 years ago)
- Last Synced: 2025-12-30T09:59:16.990Z (5 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
StormSpans
==========
StormSpans brings support for PostgreSQL's
`range types `_
to Canonical's `Storm ORM `_ using
`PsycoSpans `_ paired with
`Spans `_.
This package's functionality probably be merged with
`storm-legacy `_ in the future.
Installation
------------
Psycospans exists on PyPI.
.. code-block:: bash
pip install psycospans
Documentation
-------------
For full doumentation please run ``pydoc stormspans`` from a shell.
Example
-------
.. code-block:: python
from spans import intrange
from storm.locals import *
from stormspans import IntRange
class Model(Storm):
id = Int(primary=True)
span = IntRange(default=intrange(1, 10))
def __init__(self, span):
self.span = span
# NOTE: URI must start with postgres+spans://
store = Store(create_database("postgres+spans://"))
store.execute("""
CREATE TABLE int_range_test(
id SERIAL,
span int4range
)
""")
store.add(Model(intrange(1, 100))
store.commit()
Changelog
=========
Version 1.0.0
-------------
Released on 9th October 2018
- Added support for `storm-legacy `_
- Added support for Python 3.4 and later. Note that this only work with
``storm-legacy`` since Storm is not Python 3 compatible
Version 0.1.0
-------------
Released 12th June 2014
- Initial commit