diff options
| author | Michael Trier <mtrier@gmail.com> | 2009-07-27 02:12:15 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2009-07-27 02:12:15 +0000 |
| commit | 34aaabf7ea18af8e8a7721238b5bba00e3532c4c (patch) | |
| tree | e1073f8dc9a4b1b643e79a658b00a09c7da4d569 /examples/elementtree | |
| parent | 73554aa4fa60459cd949ca8ac690ac0746a7c445 (diff) | |
| download | sqlalchemy-34aaabf7ea18af8e8a7721238b5bba00e3532c4c.tar.gz | |
Added in Examples into the test suite so they get exercised regularly. Cleaned up some deprecation warnings in the examples.
Diffstat (limited to 'examples/elementtree')
| -rw-r--r-- | examples/elementtree/__init__.py | 0 | ||||
| -rw-r--r-- | examples/elementtree/pickle.py | 7 |
2 files changed, 6 insertions, 1 deletions
diff --git a/examples/elementtree/__init__.py b/examples/elementtree/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/examples/elementtree/__init__.py diff --git a/examples/elementtree/pickle.py b/examples/elementtree/pickle.py index 220bb2295..2176512cf 100644 --- a/examples/elementtree/pickle.py +++ b/examples/elementtree/pickle.py @@ -26,12 +26,17 @@ from xml.etree import ElementTree engine = create_engine('sqlite://') meta = MetaData(engine) +# setup a comparator for the PickleType since it's a mutable +# element. +def are_elements_equal(x, y): + return x == y + # stores a top level record of an XML document. # the "element" column will store the ElementTree document as a BLOB. documents = Table('documents', meta, Column('document_id', Integer, primary_key=True), Column('filename', String(30), unique=True), - Column('element', PickleType) + Column('element', PickleType(comparator=are_elements_equal)) ) meta.create_all() |
