Storm 0.18
Milestone information
- Active:
- No. Drivers cannot target bugs and blueprints to this milestone.
Activities
- Assigned to you:
- No blueprints or bugs assigned to you.
- Assignees:
- 2 Free Ekanayaka, 1 Gavin Panella, 1 Gustavo Niemeyer, 1 James Henstridge, 1 Jamu Kakar, 1 Jeroen T. Vermeulen, 2 Thomas Herve
- Blueprints:
- No blueprints are targeted to this milestone.
- Bugs:
- 9 Fix Released
Download files for this release
Release notes
The Storm team is proud to announce Storm 0.18!
The new release includes a number of new features:
* Storm includes (optional) code to manage and migrate database schemas
* storm.zope.testing added testresources
(https:/
* TimeoutErrors include messages to describe why the Timeout was raised
This release includes official packages for all supported releases
of Ubuntu except 10.10. 10.10 packages will be added after problems with
Storm's release machinery are sorted out. The packages are available in the
Storm team's PPA:
https:/
You can find the release files at:
https:/
You can always get the latest source code from Launchpad:
bzr branch lp:storm
Finally, you can join us in the #storm channel on irc.freenode.net
and on the Storm mailing list:
https:/
Read on for more...
Code to manage and migrate database schemas
-------
The new ``storm.schema`` package includes a generalized version of the code
used by the Landscape team for their schemas.
The ``Schema`` class can be used to ``create``, ``drop``, ``delete`` and
``upgrade`` database schemas. A ``Store`` may have a single schema. The
schema is defined by the series of SQL statements that should be used to
create, drop and clear the schema, respectively; and by a patch package used
to upgrade it.
A patch package is simply a Python package that contains files for each patch
level in the series. Each file must be named ``patch_N.py``, where ``N`` is
the numeric version of the patch in the series (using ascending natural
numbers). The patch files must define an ``apply`` callable taking a
``Store`` instance as its only argument. This will be called when the patch
gets applied.
Here's an example, where ``patch_package`` is a Python module
containing database patches used to upgrade the schema over time, and
``store`` is a Storm ``Store``:
>>> from storm.schema import Schema
>>> creates = ['CREATE TABLE person (id INTEGER, name TEXT)']
>>> drops = ['DROP TABLE person']
>>> deletes = ['DELETE FROM person']
>>> import patch_package
>>> schema = Schema(creates, drops, deletes, patch_package)
>>> schema.
While you can use the schema's ``create`` method separately, ``upgrade`` is
sufficient alone. It will create the schema if it does not exist, and
otherwise will run unapplyed patches to an existing schema. Note that this
approach therefore expects the "creates" SQL (that is, the second line of the
example above) to be maintained alongside patches--it should be *equivalent*
to running all patches.
storm.zope.testing added testresources support
-------
If you would like to use testresources
(https:/
storm.zope.
registered with ZStorm is now available. It can be used roughly like this::
from testresources import ResourcedTestCase
from storm.zope.testing import ZStormResourceM
from storm.schema import Schema
name = "test"
uri = "sqlite:"
schema = Schema(...)
manager = ZStormResourceM
class MyTest(
resources = [("zstorm", manager)]
def test_stuff(self):
store = self.zstorm.
Comparable expressions (such as Column and Alias) provide new
startswith(), endswith() and contains_string() methods. These
methods perform prefix, suffix and substring comparisons using LIKE.
Strings used with these methods are automatically escaped.
Changelog
0 blueprints and 9 bugs targeted
Bug report | Importance | Assignee | Status | |||
---|---|---|---|---|---|---|
620508 | #620508 | Slicing a ResultSet breaks subsequent count() calls. | 3 High | Thomas Herve | 10 Fix Released | |
620615 | #620615 | please contact the developers | 3 High | Gustavo Niemeyer | 10 Fix Released | |
659078 | #659078 | sqlobject is_empty and __nonzero__ are incorrect | 3 High | Jeroen T. Vermeulen | 10 Fix Released | |
585704 | #585704 | Storm test suite fails when using psycopg2 2.2 | 4 Medium | James Henstridge | 10 Fix Released | |
619017 | #619017 | __storm_loaded__ called on empty object | 4 Medium | Thomas Herve | 10 Fix Released | |
250412 | #250412 | Provide a way to manage and migrate database schemas | 5 Low | Free Ekanayaka | 10 Fix Released | |
617973 | #617973 | timeouterror could be more clear about the implications | 5 Low | Jamu Kakar | 10 Fix Released | |
659883 | #659883 | IResultSet is missing several methods that exist on ResultSet | 5 Low | Gavin Panella | 10 Fix Released | |
618704 | #618704 | Add a storm testresource to manage stores in unit tests | 1 Undecided | Free Ekanayaka | 10 Fix Released |