The :class:`.Sequence` prior to version 1.3 was used to control parameters for
the IDENTITY column in SQL Server; this usage emitted deprecation warnings
-throughout 1.3 and is now removed in 1.4. For control of paramters for an
+throughout 1.3 and is now removed in 1.4. For control of parameters for an
IDENTITY column, the ``mssql_identity_start`` and ``mssql_identity_increment``
parameters should be used; see the MSSQL dialect documentation linked below.
keywords = Table(
'keywords', Base.metadata,
Column('author_id', Integer, ForeignKey('authors.id')),
- Column('keyword_id', Integer, ForeignKey('keywords.id'))
+ Column('keyword_id', Integer, ForeignKey('keyword.id'))
)
class Author(Base):
self._shard_id = None
def set_shard(self, shard_id):
- """return a new query, limited to a single shard ID.
+ """Return a new query, limited to a single shard ID.
- all subsequent operations with the returned query will
+ All subsequent operations with the returned query will
be against the single shard regardless of other state.
The shard_id can be passed for a 2.0 style execution to the
where the query should be issued. Results from all shards returned
will be combined together into a single listing.
- .. versionchanged:: 1.4 The ``execute_chooser`` paramter
+ .. versionchanged:: 1.4 The ``execute_chooser`` parameter
supersedes the ``query_chooser`` parameter.
:param shards: A dictionary of string shard names
return self.parent.parent
For the expression, things are not so clear. We'd need to construct a
-:class:`_query.Query` where we :meth:`_query.Query.join` twice along ``Node.
-parent`` to
+:class:`_query.Query` where we :meth:`_query.Query.join` twice along
+``Node.parent`` to
get to the ``grandparent``. We can instead return a transforming callable
that we'll combine with the :class:`.Comparator` class to receive any
:class:`_query.Query` object, and return a new one that's joined to the
class Node(Base):
__tablename__ = 'node'
- id =Column(Integer, primary_key=True)
+ id = Column(Integer, primary_key=True)
parent_id = Column(Integer, ForeignKey('node.id'))
parent = relationship("Node", remote_side=id)
.. note::
- when referring to a hybrid property from an owning class (e.g.
+ When referring to a hybrid property from an owning class (e.g.
``SomeClass.some_hybrid``), an instance of
:class:`.QueryableAttribute` is returned, representing the
expression or comparator object as well as this hybrid object.
.. note::
- when referring to a hybrid property from an owning class (e.g.
+ When referring to a hybrid property from an owning class (e.g.
``SomeClass.some_hybrid``), an instance of
:class:`.QueryableAttribute` is returned, representing the
expression or comparator object as this hybrid object. However,
The value of this attribute must be a callable and will be passed a class
object. The callable must return one of:
- - An instance of an InstrumentationManager or subclass
+ - An instance of an :class:`.InstrumentationManager` or subclass
- An object implementing all or some of InstrumentationManager (TODO)
- A dictionary of callables, implementing all or some of the above (TODO)
- - An instance of a ClassManager or subclass
+ - An instance of a :class:`.ClassManager` or subclass
This attribute is consulted by SQLAlchemy instrumentation
resolution, once the :mod:`sqlalchemy.ext.instrumentation` module
__slots__ = ()
is_selectable = False
- """Return True if this object is an instance of """
- """:class:`expression.Selectable`."""
+ """Return True if this object is an instance of
+ :class:`_expression.Selectable`."""
is_aliased_class = False
"""True if this object is an instance of :class:`.AliasedClass`."""
"""
is_clause_element = False
- """True if this object is an instance of """
- """:class:`_expression.ClauseElement`."""
+ """True if this object is an instance of
+ :class:`_expression.ClauseElement`."""
extension_type = NOT_EXTENSION
"""The extension type, if any.
class ClassManager(HasMemoized, dict):
- """tracks state information at the class level."""
+ """Tracks state information at the class level."""
MANAGER_ATTR = base.DEFAULT_MANAGER_ATTR
STATE_ATTR = base.DEFAULT_STATE_ATTR
@property
def transient(self):
- """Return true if the object is :term:`transient`.
+ """Return ``True`` if the object is :term:`transient`.
.. seealso::
@property
def pending(self):
- """Return true if the object is :term:`pending`.
+ """Return ``True`` if the object is :term:`pending`.
.. seealso::
@property
def deleted(self):
- """Return true if the object is :term:`deleted`.
+ """Return ``True`` if the object is :term:`deleted`.
An object that is in the deleted state is guaranteed to
not be within the :attr:`.Session.identity_map` of its parent
@property
def persistent(self):
- """Return true if the object is :term:`persistent`.
+ """Return ``True`` if the object is :term:`persistent`.
An object that is in the persistent state is guaranteed to
be within the :attr:`.Session.identity_map` of its parent
@property
def detached(self):
- """Return true if the object is :term:`detached`.
+ """Return ``True`` if the object is :term:`detached`.
.. seealso::
"""Return ``True`` if this object has an identity key.
This should always have the same value as the
- expression ``state.persistent or state.detached``.
+ expression ``state.persistent`` or ``state.detached``.
"""
return bool(self.key)
return bool(self.states)
def was_already_deleted(self, state):
- """return true if the given state is expired and was deleted
+ """Return ``True`` if the given state is expired and was deleted
previously.
"""
if state.expired:
return False
def is_deleted(self, state):
- """return true if the given state is marked as deleted
+ """Return ``True`` if the given state is marked as deleted
within this uowtransaction."""
return state in self.states and self.states[state][0]
return ret
def remove_state_actions(self, state):
- """remove pending actions for a state from the uowtransaction."""
+ """Remove pending actions for a state from the uowtransaction."""
isdelete = self.states[state][0]
def get_attribute_history(
self, state, key, passive=attributes.PASSIVE_NO_INITIALIZE
):
- """facade to attributes.get_state_history(), including
+ """Facade to attributes.get_state_history(), including
caching of results."""
hashkey = ("history", state, key)
rec.execute(self)
def finalize_flush_changes(self):
- """mark processed objects as clean / deleted after a successful
+ """Mark processed objects as clean / deleted after a successful
flush().
- this method is called within the flush() method after the
+ This method is called within the flush() method after the
execute() method has succeeded and the transaction has been committed.
"""
class CascadeOptions(frozenset):
- """Keeps track of the options sent to relationship().cascade"""
+ """Keeps track of the options sent to
+ :paramref:`.relationship.cascade`"""
_add_w_all_cascades = all_cascades.difference(
["all", "none", "delete-orphan"]
}
def combinations(self, *arg_sets, **kw):
- """facade for pytest.mark.paramtrize.
+ """Facade for pytest.mark.parametrize.
Automatically derives argument names from the callable which in our
case is always a method on a class with positional arguments.