]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix typos in documentation - ORM Extensions
authoraplatkouski <5857672+aplatkouski@users.noreply.github.com>
Sun, 7 Jun 2020 11:22:35 +0000 (14:22 +0300)
committeraplatkouski <5857672+aplatkouski@users.noreply.github.com>
Tue, 16 Jun 2020 18:26:52 +0000 (21:26 +0300)
Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com>
doc/build/changelog/migration_14.rst
doc/build/orm/extensions/declarative/relationships.rst
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/ext/hybrid.py
lib/sqlalchemy/ext/instrumentation.py
lib/sqlalchemy/orm/base.py
lib/sqlalchemy/orm/instrumentation.py
lib/sqlalchemy/orm/state.py
lib/sqlalchemy/orm/unitofwork.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/testing/plugin/pytestplugin.py

index 6702f86f0cd7a8771eaed993dfc57e0363067d58..3314e8d9b637ad098b6cb4e774591ec562dd9cec 100644 (file)
@@ -1615,7 +1615,7 @@ on the table.
 
 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.
 
index d33d44245444cf6f15344829801cc4eac06548ad..5d81cee30acd664a0167e6063aacef669a3f2782 100644 (file)
@@ -155,7 +155,7 @@ the :class:`_schema.MetaData` object used by the declarative base::
     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):
index 0983807cb9664172fdc89e09bb81fd487c05f19a..b8ce1e4a0a33beac3246e40b126c7c2e05243c96 100644 (file)
@@ -34,9 +34,9 @@ class ShardedQuery(Query):
         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
@@ -79,7 +79,7 @@ class ShardedSession(Session):
           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
index efd8d7d6b2a2b7642362deac0e2117873e296395..6b4cf989ca2a8d3dbf58ea2a82ffbb614532c156 100644 (file)
@@ -668,8 +668,8 @@ simple::
             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
@@ -690,7 +690,7 @@ that we'll combine with the :class:`.Comparator` class to receive any
 
     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)
 
@@ -987,7 +987,7 @@ class hybrid_property(interfaces.InspectionAttrInfo):
 
         .. 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.
@@ -1027,7 +1027,7 @@ class hybrid_property(interfaces.InspectionAttrInfo):
 
         .. 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,
index 378d7445f901d90e8332f2c8ef2791aafb310242..300d0d81cfa4199ce6c85a856a2c665cc55b5dea 100644 (file)
@@ -42,10 +42,10 @@ inheritance hierarchy.
 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
index 54e45cd1a09f0bb2e6ce84daf1b50211801ed7ea..1e6f1ee2a12eab97368628edd99c429906e7c15f 100644 (file)
@@ -463,8 +463,8 @@ class InspectionAttr(object):
     __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`."""
@@ -505,8 +505,8 @@ class InspectionAttr(object):
     """
 
     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.
index 432bff7d41326b738c63ed509b2fd3aad27db9b4..e2f0c6a288da98f08dbd0a8b209bb06f2b3c7459 100644 (file)
@@ -40,7 +40,7 @@ from ..util import HasMemoized
 
 
 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
index 48546f24ea3dfcca5c7bdd9447cf5cefa331e5f1..2332834977832eee5791b21a2bfb6f0fd388331d 100644 (file)
@@ -119,7 +119,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def transient(self):
-        """Return true if the object is :term:`transient`.
+        """Return ``True`` if the object is :term:`transient`.
 
         .. seealso::
 
@@ -130,7 +130,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def pending(self):
-        """Return true if the object is :term:`pending`.
+        """Return ``True`` if the object is :term:`pending`.
 
 
         .. seealso::
@@ -142,7 +142,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @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
@@ -196,7 +196,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @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
@@ -217,7 +217,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def detached(self):
-        """Return true if the object is :term:`detached`.
+        """Return ``True`` if the object is :term:`detached`.
 
         .. seealso::
 
@@ -324,7 +324,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
         """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)
index 5a3f99e700ad1ec4837d12a5ffb2ad6b265057b5..97eea48642a93130d3393a307220ea03677330a9 100644 (file)
@@ -177,7 +177,7 @@ class UOWTransaction(object):
         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:
@@ -189,7 +189,7 @@ class UOWTransaction(object):
         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]
@@ -202,7 +202,7 @@ class UOWTransaction(object):
             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]
 
@@ -211,7 +211,7 @@ class UOWTransaction(object):
     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)
@@ -421,10 +421,10 @@ class UOWTransaction(object):
                 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.
 
         """
index 8726935f8435cb6d8b47b37e4baeb152035f0dc5..3630b08af39c6c061775eaf837f2706ec3e24d72 100644 (file)
@@ -60,7 +60,8 @@ all_cascades = frozenset(
 
 
 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"]
index 9dc40c9fefba20c11a0f5efdaa9d96c8c6918dcf..015598952db6b82c5055121db34593978fe18327 100644 (file)
@@ -371,7 +371,7 @@ class PytestFixtureFunctions(plugin_base.FixtureFunctions):
     }
 
     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.