diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-10-15 23:00:06 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-10-15 23:00:06 +0000 |
| commit | eb6f1f87f6f632c16bde4b8e947f6e302e7c5c8b (patch) | |
| tree | bb16d8805115990e603fe1da93251f93ef5f1c3e /lib/sqlalchemy/ext | |
| parent | 53f1c775db8f58ed33f3e35bbb3bd36961442c0c (diff) | |
| download | sqlalchemy-eb6f1f87f6f632c16bde4b8e947f6e302e7c5c8b.tar.gz | |
deprecations per [ticket:1498]:
- deprecated PassiveDefault - use DefaultClause.
- the BINARY and MSBinary types now generate "BINARY" in all
cases. Omitting the "length" parameter will generate
"BINARY" with no length. Use BLOB to generate an unlengthed
binary column.
- the "quoting='quoted'" argument to MSEnum/ENUM is deprecated.
It's best to rely upon the automatic quoting.
- "shortname" attribute on bindparam() is removed.
- fold_equivalents flag on join is deprecated (will remain
until [ticket:1131] is implemented)
- "scalar" flag on select() is removed, use
select.as_scalar().
- 'transactional' flag on sessionmaker() and others is
removed. Use 'autocommit=True' to indicate 'transactional=False'.
- 'polymorphic_fetch' argument on mapper() is removed.
Loading can be controlled using the 'with_polymorphic'
option.
- 'select_table' argument on mapper() is removed. Use
'with_polymorphic=("*", <some selectable>)' for this
functionality.
- 'proxy' argument on synonym() is removed. This flag
did nothing throughout 0.5, as the "proxy generation"
behavior is now automatic.
- Passing a single list of elements to eagerload(),
eagerload_all(), contains_eager(), lazyload(),
defer(), and undefer() instead of multiple positional
-args is deprecated.
- Passing a single list of elements to query.order_by(),
query.group_by(), query.join(), or query.outerjoin()
instead of multiple positional *args is deprecated.
- query.iterate_instances() is removed. Use query.instances().
- Query.query_from_parent() is removed. Use the
sqlalchemy.orm.with_parent() function to produce a
"parent" clause, or alternatively query.with_parent().
- query._from_self() is removed, use query.from_self()
instead.
- the "comparator" argument to composite() is removed.
Use "comparator_factory".
- RelationProperty._get_join() is removed.
- the 'echo_uow' flag on Session is removed. Use
logging on the "sqlalchemy.orm.unitofwork" name.
- session.clear() is removed. use session.expunge_all().
- session.save(), session.update(), session.save_or_update()
are removed. Use session.add() and session.add_all().
- the "objects" flag on session.flush() remains deprecated.
- the "dont_load=True" flag on session.merge() is deprecated
in favor of "load=False".
- passing an InstanceState (internal SQLAlchemy state object) to
attributes.init_collection() or attributes.get_history() is
deprecated. These functions are public API and normally
expect a regular mapped object instance.
- the 'engine' parameter to declarative_base() is removed.
Use the 'bind' keyword argument.
Diffstat (limited to 'lib/sqlalchemy/ext')
| -rw-r--r-- | lib/sqlalchemy/ext/declarative.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 5d712df0f..816bcf3e8 100644 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -700,7 +700,7 @@ _declarative_constructor.__name__ = '__init__' def declarative_base(bind=None, metadata=None, mapper=None, cls=object, name='Base', constructor=_declarative_constructor, - metaclass=DeclarativeMeta, engine=None): + metaclass=DeclarativeMeta): """Construct a base class for declarative class definitions. The new base class will be given a metaclass that invokes @@ -710,7 +710,7 @@ def declarative_base(bind=None, metadata=None, mapper=None, cls=object, :param bind: An optional :class:`~sqlalchemy.engine.base.Connectable`, will be assigned the ``bind`` attribute on the :class:`~sqlalchemy.MetaData` instance. - The `engine` keyword argument is a deprecated synonym for `bind`. + :param metadata: An optional :class:`~sqlalchemy.MetaData` instance. All :class:`~sqlalchemy.schema.Table` @@ -747,8 +747,8 @@ def declarative_base(bind=None, metadata=None, mapper=None, cls=object, """ lcl_metadata = metadata or MetaData() - if bind or engine: - lcl_metadata.bind = bind or engine + if bind: + lcl_metadata.bind = bind bases = not isinstance(cls, tuple) and (cls,) or cls class_dict = dict(_decl_class_registry=dict(), |
