+
==============
0.9 Changelog
==============
:versions: 1.0.0
:pullrequest: bitbucket:28
- Fixed bug where :ref:`ext.mutable.MutableDict`
+ Fixed bug where :class:`.ext.mutable.MutableDict`
failed to implement the ``update()`` dictionary method, thus
not catching changes. Pull request courtesy Matt Chisholm.
:versions: 1.0.0
:pullrequest: bitbucket:27
- Fixed bug where a custom subclass of :ref:`ext.mutable.MutableDict`
+ Fixed bug where a custom subclass of :class:`.ext.mutable.MutableDict`
would not show up in a "coerce" operation, and would instead
- return a plain :ref:`ext.mutable.MutableDict`. Pull request
+ return a plain :class:`.ext.mutable.MutableDict`. Pull request
courtesy Matt Chisholm.
.. change::
:tickets: 3078
Added kw argument ``postgresql_regconfig`` to the
- :meth:`.Operators.match` operator, allows the "reg config" argument
+ :meth:`.ColumnOperators.match` operator, allows the "reg config" argument
to be specified to the ``to_tsquery()`` function emitted.
Pull request courtesy Jonathan Vanasco.
translated through some kind of SQL function or expression. This
is kind of experimental, but the first proof of concept is a
"materialized path" join condition where a path string is compared
- to itself using "like". The :meth:`.Operators.like` operator has
+ to itself using "like". The :meth:`.ColumnOperators.like` operator has
also been added to the list of valid operators to use in a primaryjoin
condition.
Fixed an issue where the C extensions in Py3K are using the wrong API
to specify the top-level module function, which breaks
in Python 3.4b2. Py3.4b2 changes PyMODINIT_FUNC to return
- "void" instead of "PyObject *", so we now make sure to use
- "PyMODINIT_FUNC" instead of "PyObject *" directly. Pull request
+ "void" instead of ``PyObject *``, so we now make sure to use
+ "PyMODINIT_FUNC" instead of ``PyObject *`` directly. Pull request
courtesy cgohlke.
.. change::
:tags: bug, mysql
:tickets: 3263
- The :meth:`.Operators.match` operator is now handled such that the
+ The :meth:`.ColumnOperators.match` operator is now handled such that the
return type is not strictly assumed to be boolean; it now
returns a :class:`.Boolean` subclass called :class:`.MatchType`.
The type will still produce boolean behavior when used in Python
.. change::
:tags: bug, orm, py3k
- The :class:`.IdentityMap` exposed from :class:`.Session.identity`
+ The :class:`.IdentityMap` exposed from :class:`.Session.identity_map`
now returns lists for ``items()`` and ``values()`` in Py3K.
Early porting to Py3K here had these returning iterators, when
they technically should be "iterable views"..for now, lists are OK.
:tags: orm, feature
:tickets: 2971
- The :meth:`.InspectionAttr.info` collection is now moved down to
+ The :attr:`.InspectionAttr.info` collection is now moved down to
:class:`.InspectionAttr`, where in addition to being available
on all :class:`.MapperProperty` objects, it is also now available
on hybrid properties, association proxies, when accessed via
-.. _migration_migration_deprecated_orm_events:
+.. _migration_deprecated_orm_events:
Deprecated ORM Event Hooks Removed
----------------------------------
The match() operator now returns an agnostic MatchType compatible with MySQL's floating point return value
----------------------------------------------------------------------------------------------------------
-The return type of a :meth:`.Operators.match` expression is now a new type
+The return type of a :meth:`.ColumnOperators.match` expression is now a new type
called :class:`.MatchType`. This is a subclass of :class:`.Boolean`,
that can be intercepted by the dialect in order to produce a different
result type at SQL execution time.
Dialect Improvements and Changes - SQLite
=============================================
-.. _change_2984:
-
SQLite named and unnamed UNIQUE and FOREIGN KEY constraints will inspect and reflect
-------------------------------------------------------------------------------------
'zzzeeksphinx',
'changelog',
'sphinx_paramlinks',
+ 'corrections'
]
# Add any paths that contain templates here, relative to this directory.
'alembic': ('http://alembic.readthedocs.org/en/latest/', None),
'psycopg2': ('http://pythonhosted.org/psycopg2', None),
}
+
+
===============================================
.. automodule:: sqlalchemy.ext.compiler
- :members:
\ No newline at end of file
+ :members:
+.. module:: sqlalchemy.types
+
.. _types_custom:
Custom Types
===============
.. automodule:: sqlalchemy.exc
- :members:
\ No newline at end of file
+ :members:
type_basics
custom_types
- type_api
\ No newline at end of file
+ type_api
--- /dev/null
+targets = {}
+quit = False
+def missing_reference(app, env, node, contnode):
+ global quit
+ if quit:
+ return
+ reftarget = node.attributes['reftarget']
+ reftype = node.attributes['reftype']
+ refdoc = node.attributes['refdoc']
+ rawsource = node.rawsource
+ if reftype == 'paramref':
+ return
+
+ target = rawsource
+ if target in targets:
+ return
+ print "\n%s" % refdoc
+ print "Reftarget: %s" % rawsource
+ correction = raw_input("? ")
+ correction = correction.strip()
+ if correction == ".":
+ correction = ":%s:`.%s`" % (reftype, reftarget)
+ elif correction == 'q':
+ quit = True
+ else:
+ targets[target] = correction
+
+def write_corrections(app, exception):
+ print "#!/bin/sh\n\n"
+ for targ, corr in targets.items():
+ if not corr:
+ continue
+
+ print """find lib/ -print -type f -name "*.py" -exec sed -i '' 's/%s/%s/g' {} \;""" % (targ, corr)
+ print """find doc/build/ -print -type f -name "*.rst" -exec sed -i '' 's/%s/%s/g' {} \;""" % (targ, corr)
+
+def setup(app):
+ app.connect('missing-reference', missing_reference)
+ app.connect('build-finished', write_corrections)
Pysqlcipher
-----------
-.. automodule:: sqlalchemy.dialects.sqlite.pysqlcipher
\ No newline at end of file
+.. automodule:: sqlalchemy.dialects.sqlite.pysqlcipher
.. autoclass:: collection
-.. autofunction:: collection_adapter
+.. autodata:: collection_adapter
.. autoclass:: CollectionAdapter
+.. module:: sqlalchemy.orm
+
.. _mapping_constructors:
Constructors and Object Initialization
==============
.. automodule:: sqlalchemy.orm.exc
- :members:
\ No newline at end of file
+ :members:
:members:
:undoc-members:
-.. autodata:: ASSOCIATION_PROXY
\ No newline at end of file
+.. autodata:: ASSOCIATION_PROXY
.. autoclass:: MutableDict
:members:
-
+ :undoc-members:
.. autoclass:: sqlalchemy.orm.state.AttributeState
:members:
+.. autoclass:: sqlalchemy.orm.util.CascadeOptions
+ :members:
+
.. autoclass:: sqlalchemy.orm.instrumentation.ClassManager
:members:
:inherited-members:
:members:
:inherited-members:
+.. autoclass:: sqlalchemy.orm.properties.ComparableProperty
+ :members:
+
.. autoclass:: sqlalchemy.orm.descriptor_props.CompositeProperty
:members:
.. versionadded:: 0.9.5 Support has been added to allow a single-column
comparison to itself within a primaryjoin condition, as well as for
- primaryjoin conditions that use :meth:`.Operators.like` as the comparison
+ primaryjoin conditions that use :meth:`.ColumnOperators.like` as the comparison
operator.
.. _self_referential_many_to_many:
nonstandard_mappings
classical
versioning
- mapping_api
\ No newline at end of file
+ mapping_api
+.. module:: sqlalchemy.orm.session
+
Session API
============
In order to provide for this explicit query planning, or to use different
search strategies, the ``match`` method accepts a ``postgresql_regconfig``
-keyword argument.
+keyword argument::
select([mytable.c.id]).where(
mytable.c.title.match('somestring', postgresql_regconfig='english')
WHERE mytable.title @@ to_tsquery('english', 'somestring')
One can also specifically pass in a `'regconfig'` value to the
-``to_tsvector()`` command as the initial argument.
+``to_tsvector()`` command as the initial argument::
select([mytable.c.id]).where(
func.to_tsvector('english', mytable.c.title )\
was built. This value can be overridden by passing a pathname to psycopg2,
using ``host`` as an additional keyword argument::
- create_engine("postgresql+psycopg2://user:password@/dbname?host=/var/lib/postgresql")
+ create_engine("postgresql+psycopg2://user:password@/dbname?\
+host=/var/lib/postgresql")
See also:
-`PQconnectdbParams <http://www.postgresql.org/docs/9.1/static\
-/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS>`_
+`PQconnectdbParams <http://www.postgresql.org/docs/9.1/static/\
+libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS>`_
Per-Statement/Connection Execution Options
-------------------------------------------
* ``AUTOCOMMIT``
.. versionadded:: 0.8.2 support for AUTOCOMMIT isolation level when using
- psycopg2.
+ psycopg2.
.. seealso::
.. versionadded:: 0.9.0
:param query_cls: Class which should be used to create new Query
- objects, as returned by the :meth:`~.Session.query` method.
- Defaults to :class:`.Query`.
+ objects, as returned by the :meth:`~.Session.query` method.
+ Defaults to :class:`.Query`.
:param twophase: When ``True``, all transactions will be started as
a "two phase" transaction, i.e. using the "two phase" semantics
on returning a connection. Defaults to 30.
:param \**kw: Other keyword arguments including
- :paramref:`.Pool.recycle`, :paramref:`.Pool.echo`,
- :paramref:`.Pool.reset_on_return` and others are passed to the
- :class:`.Pool` constructor.
+ :paramref:`.Pool.recycle`, :paramref:`.Pool.echo`,
+ :paramref:`.Pool.reset_on_return` and others are passed to the
+ :class:`.Pool` constructor.
"""
Pool.__init__(self, creator, **kw)
from .selectable import Alias, Join, Select, Selectable, TableClause, \
CompoundSelect, CTE, FromClause, FromGrouping, SelectBase, \
alias, GenerativeSelect, \
- subquery, HasPrefixes, Exists, ScalarSelect, TextAsFrom
+ subquery, HasPrefixes, HasSuffixes, Exists, ScalarSelect, TextAsFrom
from .dml import Insert, Update, Delete, UpdateBase, ValuesBase
class ColumnCollectionMixin(object):
+ columns = None
+ """A :class:`.ColumnCollection` of :class:`.Column` objects.
+
+ This collection represents the columns which are referred to by
+ this object.
+
+ """
+
def __init__(self, *columns):
self.columns = ColumnCollection()
self._pending_colargs = [_to_schema_column_or_string(c)
class MatchType(Boolean):
"""Refers to the return type of the MATCH operator.
- As the :meth:`.Operators.match` is probably the most open-ended
+ As the :meth:`.ColumnOperators.match` is probably the most open-ended
operator in generic SQLAlchemy Core, we can't assume the return type
at SQL evaluation time, as MySQL returns a floating point, not a boolean,
and other backends might do something different. So this type