From: Ants Aasma Date: Thu, 26 Jul 2007 00:01:28 +0000 (+0000) Subject: fix up a docstring and some examples X-Git-Tag: rel_0_4_6~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d18786096ccef6325e9b9464e63c4b34f9d8e893;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix up a docstring and some examples --- diff --git a/examples/adjacencytree/basic_tree.py b/examples/adjacencytree/basic_tree.py index 9f937315b8..53bdc82983 100644 --- a/examples/adjacencytree/basic_tree.py +++ b/examples/adjacencytree/basic_tree.py @@ -5,7 +5,8 @@ from sqlalchemy.orm import * from sqlalchemy.util import OrderedDict from sqlalchemy.orm.collections import attribute_mapped_collection -metadata = MetaData('sqlite:///', echo=True) +metadata = MetaData('sqlite:///') +metadata.bind.echo = True trees = Table('treenodes', metadata, Column('node_id', Integer, Sequence('treenode_id_seq',optional=False), primary_key=True), diff --git a/examples/collections/large_collection.py b/examples/collections/large_collection.py index d592441ab9..3c53db121c 100644 --- a/examples/collections/large_collection.py +++ b/examples/collections/large_collection.py @@ -1,7 +1,8 @@ """illlustrates techniques for dealing with very large collections""" from sqlalchemy import * -meta = MetaData('sqlite://', echo=True) +meta = MetaData('sqlite://') +meta.bind.echo = True org_table = Table('organizations', meta, Column('org_id', Integer, primary_key=True), diff --git a/examples/pickle/custom_pickler.py b/examples/pickle/custom_pickler.py index 755e04238c..b45e16e7c6 100644 --- a/examples/pickle/custom_pickler.py +++ b/examples/pickle/custom_pickler.py @@ -6,7 +6,8 @@ from cStringIO import StringIO from pickle import Pickler, Unpickler import threading -meta = MetaData('sqlite://', echo=True) +meta = MetaData('sqlite://') +meta.bind.echo = True class MyExt(MapperExtension): def populate_instance(self, mapper, selectcontext, row, instance, identitykey, isnew): diff --git a/examples/poly_assoc/poly_assoc.py b/examples/poly_assoc/poly_assoc.py index d321e412e6..c13ffbfa19 100644 --- a/examples/poly_assoc/poly_assoc.py +++ b/examples/poly_assoc/poly_assoc.py @@ -23,7 +23,7 @@ the associated target object from those which associate with it. from sqlalchemy import * from sqlalchemy.orm import * -metadata = MetaData('sqlite://', echo=False) +metadata = MetaData('sqlite://') ####### # addresses table, class, 'addressable interface'. diff --git a/examples/poly_assoc/poly_assoc_fk.py b/examples/poly_assoc/poly_assoc_fk.py index d0aab4fd24..22ee50009a 100644 --- a/examples/poly_assoc/poly_assoc_fk.py +++ b/examples/poly_assoc/poly_assoc_fk.py @@ -22,7 +22,7 @@ poly_assoc_generic.py. from sqlalchemy import * from sqlalchemy.orm import * -metadata = MetaData('sqlite://', echo=False) +metadata = MetaData('sqlite://') ####### # addresses table, class, 'addressable interface'. diff --git a/examples/poly_assoc/poly_assoc_generic.py b/examples/poly_assoc/poly_assoc_generic.py index 82daa4182a..4fca310193 100644 --- a/examples/poly_assoc/poly_assoc_generic.py +++ b/examples/poly_assoc/poly_assoc_generic.py @@ -9,7 +9,7 @@ function "association" which creates a new polymorphic association from sqlalchemy import * from sqlalchemy.orm import * -metadata = MetaData('sqlite://', echo=False) +metadata = MetaData('sqlite://') def association(cls, table): """create an association 'interface'.""" diff --git a/examples/polymorph/polymorph.py b/examples/polymorph/polymorph.py index 498bfa775c..4f3aeb7d26 100644 --- a/examples/polymorph/polymorph.py +++ b/examples/polymorph/polymorph.py @@ -4,7 +4,8 @@ import sets # this example illustrates a polymorphic load of two classes -metadata = MetaData('sqlite://', echo=True) +metadata = MetaData('sqlite://') +metadata.bind.echo = True # a table to store companies companies = Table('companies', metadata, diff --git a/examples/polymorph/single.py b/examples/polymorph/single.py index 61809a05c1..dfc4264169 100644 --- a/examples/polymorph/single.py +++ b/examples/polymorph/single.py @@ -1,7 +1,8 @@ from sqlalchemy import * from sqlalchemy.orm import * -metadata = MetaData('sqlite://', echo='debug') +metadata = MetaData('sqlite://') +metadata.bind.echo = 'debug' # a table to store companies companies = Table('companies', metadata, diff --git a/examples/vertical/vertical.py b/examples/vertical/vertical.py index 75e56935c8..e3b48c3369 100644 --- a/examples/vertical/vertical.py +++ b/examples/vertical/vertical.py @@ -7,7 +7,8 @@ from sqlalchemy.orm import * from sqlalchemy.orm.collections import mapped_collection import datetime -e = MetaData('sqlite://', echo=True) +e = MetaData('sqlite://') +e.bind.echo = True # this table represents Entity objects. each Entity gets a row in this table, # with a primary key and a title. diff --git a/lib/sqlalchemy/databases/informix.py b/lib/sqlalchemy/databases/informix.py index 43de41b786..5aad21b433 100644 --- a/lib/sqlalchemy/databases/informix.py +++ b/lib/sqlalchemy/databases/informix.py @@ -119,7 +119,7 @@ class InfoBoolean(sqltypes.Boolean): elif value is None: return None else: - return value and True or False + return value and True or False colspecs = { diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 28a503cc03..08c1f6bab0 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -1079,8 +1079,8 @@ class MetaData(SchemaItem): bind an Engine, or a string or URL instance which will be passed - to create_engine(), along with \**kwargs - this MetaData will - be bound to the resulting engine. + to create_engine(), this MetaData will be bound to the resulting + engine. case_sensitive popped from \**kwargs, indicates default case sensitive setting for