]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix indentation and escape *args and **kwargs
authorVraj Mohan <r.vrajmohan@gmail.com>
Tue, 12 Nov 2013 19:39:18 +0000 (14:39 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 13 Nov 2013 04:50:55 +0000 (23:50 -0500)
doc/build/changelog/changelog_01.rst
doc/build/changelog/changelog_02.rst
doc/build/changelog/changelog_03.rst
doc/build/changelog/changelog_04.rst
doc/build/changelog/changelog_05.rst
doc/build/changelog/changelog_06.rst
doc/build/changelog/changelog_07.rst
doc/build/changelog/migration_04.rst
doc/build/changelog/migration_07.rst

index 156599a13e6c7004d158fd4d1a74367b526d46c6..0f66f99e4537a54917e387d4818bac45f012a836 100644 (file)
         :tickets: 
 
       added a "mods" system which allows pluggable modules that modify/augment
-      core functionality, using the function "install_mods(*modnames)".
+      core functionality, using the function "install_mods(\*modnames)".
 
     .. change::
         :tags: 
         :tags: 
         :tickets: 
 
-      added *args, **kwargs pass-thru to engine.transaction(func) allowing easier
+      added \*args, \**kwargs pass-thru to engine.transaction(func) allowing easier
       creation of transactionalizing decorator functions
 
     .. change::
 
       create_engine() now uses genericized parameters; host/hostname,
       db/dbname/database, password/passwd, etc. for all engine connections. makes
-       engine URIs much more "universal"
+      engine URIs much more "universal"
 
     .. change::
         :tags: 
         :tags: 
         :tickets: 
 
-      added 'get_session().invalidate(*obj)' method to objectstore, instances will
+      added 'get_session().invalidate(\*obj)' method to objectstore, instances will
       refresh() themselves upon the next attribute access.
 
     .. change::
         :tags: 
         :tickets: 
 
-      added "refresh(*obj)" method to objectstore / Session to reload the attributes of
+      added "refresh(\*obj)" method to objectstore / Session to reload the attributes of
       any set of objects from the database unconditionally
 
 .. changelog::
 
       two issues related to postgres, which doesnt want to give you the "lastrowid"
       since oids are deprecated:
-         * postgres database-side defaults that are on primary key cols *do* execute
-      explicitly beforehand, even though thats not the idea of a PassiveDefault.  this is
-      because sequences on columns get reflected as PassiveDefaults, but need to be explicitly
-      executed on a primary key col so we know what we just inserted.
-         * if you did add a row that has a bunch of database-side defaults on it,
-      and the PassiveDefault thing was working the old way, i.e. they just execute on
-      the DB side, the "cant get the row back without an OID" exception that occurred
-      also will not happen unless someone (usually the ORM) explicitly asks for it.
+
+        * postgres database-side defaults that are on primary key cols *do* execute
+          explicitly beforehand, even though thats not the idea of a PassiveDefault.  this is
+          because sequences on columns get reflected as PassiveDefaults, but need to be explicitly
+          executed on a primary key col so we know what we just inserted.
+        * if you did add a row that has a bunch of database-side defaults on it,
+          and the PassiveDefault thing was working the old way, i.e. they just execute on
+          the DB side, the "cant get the row back without an OID" exception that occurred
+          also will not happen unless someone (usually the ORM) explicitly asks for it.
 
     .. change::
         :tags: 
index 600dcc6ebdfbe22c9fbf067621e972df2486f9e7..a2b0ab10bdd97cf586c0a4af1546575aef67d2c1 100644 (file)
         :tags: 
         :tickets: 287
 
-      fix to using query.count() with distinct, **kwargs with SelectResults
+      fix to using query.count() with distinct, \**kwargs with SelectResults
       count()
 
     .. change::
index e47da340a1704b9c325909d21b408a713fe8e778..05e10e6649d007f572ae0bb70d83b16112c42c50 100644 (file)
         :tags: orm
         :tickets: 
 
-      session.get() and session.load() propagate **kwargs through to
+      session.get() and session.load() propagate \**kwargs through to
       query
 
     .. change::
         :tickets: 
 
       query strings in unicode URLs get keys encoded to ascii
-      for **kwargs compat
+      for \**kwargs compat
 
     .. change::
         :tags: sql
         :tickets: 
 
       support for SSL arguments given as inline within URL query string,
-      prefixed with "ssl_", courtesy terjeros@gmail.com.
+      prefixed with "ssl\_", courtesy terjeros@gmail.com.
 
     .. change::
         :tags: <schemaname>, mysql
         :tags: sql
         :tickets: 
 
-      the "else_" parameter to the case statement now properly works when
+      the "else\_" parameter to the case statement now properly works when
       set to zero.
 
     .. change::
       and a new one returned with additional criterion added.
       The new methods include:
       
-          filter() - applies select criterion to the query
-          filter_by() - applies "by"-style criterion to the query
-          avg() - return the avg() function on the given column
-          join() - join to a property (or across a list of properties)
-          outerjoin() - like join() but uses LEFT OUTER JOIN
-          limit()/offset() - apply LIMIT/OFFSET
-          range-based access which applies limit/offset:
-             session.query(Foo)[3:5]
-          distinct() - apply DISTINCT
-          list() - evaluate the criterion and return results
+          * filter() - applies select criterion to the query
+          * filter_by() - applies "by"-style criterion to the query
+          * avg() - return the avg() function on the given column
+          * join() - join to a property (or across a list of properties)
+          * outerjoin() - like join() but uses LEFT OUTER JOIN
+          * limit()/offset() - apply LIMIT/OFFSET range-based access 
+            which applies limit/offset: session.query(Foo)[3:5]
+          * distinct() - apply DISTINCT
+          * list() - evaluate the criterion and return results
       
       no incompatible changes have been made to Query's API and no methods
       have been deprecated.  Existing methods like select(), select_by(),
         :tags: orm
         :tickets: 
 
-      strings and columns can also be sent to the *args of instances()
+      strings and columns can also be sent to the \*args of instances()
       where those exact result columns will be part of the result tuples.
 
     .. change::
         :tags: mysql
         :tickets: 
 
-      added a catchall **kwargs to MSString, to help reflection of
+      added a catchall \**kwargs to MSString, to help reflection of
       obscure types (like "varchar() binary" in MS 4.0)
 
     .. change::
         :tickets: 
 
       fixed argument passing to straight textual execute() on engine,
-      connection. can handle *args or a list instance for positional, **kwargs
+      connection. can handle \*args or a list instance for positional, \**kwargs
       or a dict instance for named args, or a list of list or dicts to invoke
       executemany()
 
         :tags: engine/pool
         :tickets: 
 
-      create_engine() reworked to be strict about incoming **kwargs.  all keyword
+      create_engine() reworked to be strict about incoming \**kwargs.  all keyword
       arguments must be consumed by one of the dialect, connection pool, and engine
       constructors, else a TypeError is thrown which describes the full set of
       invalid kwargs in relation to the selected dialect/pool/engine configuration.
index e1acfe4c0a7c9302ae21a17b196272e1efc3a039..61ea28c119e61331725a3d1207a821e4080dc4b6 100644 (file)
         :tickets: 
 
       Added "add()" and "add_all()" to scoped_session
-      methods.  Workaround for 0.4.7:
+      methods.  Workaround for 0.4.7::
       
-        from sqlalchemy.orm.scoping import ScopedSession,\
-        instrument
-        setattr(
-            ScopedSession, "add", instrument("add"))
-        setattr(
-            ScopedSession, "add_all", instrument("add_all"))
+        from sqlalchemy.orm.scoping import ScopedSession, instrument
+        setattr(ScopedSession, "add", instrument("add"))
+        setattr(ScopedSession, "add_all", instrument("add_all"))
 
     .. change::
         :tags: orm
         :tags: orm
         :tickets: 
 
-      set-based collections |=, -=, ^= and &= are stricter about
+      set-based collections \|=, -=, ^= and &= are stricter about
       their operands and only operate on sets, frozensets or
       subclasses of the collection type. Previously, they would
       accept any duck-typed set.
         :tags: ext
         :tickets: 
 
-      set-based association proxies |=, -=, ^= and &= are
+      set-based association proxies \|=, -=, ^= and &= are
       stricter about their operands and only operate on sets,
       frozensets or other association proxies. Previously, they
       would accept any duck-typed set.
       
       The new approach also automatically allows eager loads
       to work for subclasses, if they are present, for
-      example
+      example::
+
         sess.query(Company).options(
          eagerload_all(
-         
         ))
+
       to load Company objects, their employees, and the
       'machines' collection of employees who happen to be
       Engineers. A "with_polymorphic" Query option should be
       is not carved in stone just yet:  _values() and
       _from_self().  We'd like feedback on these.
       
-      - _values(*columns) is given a list of column
+      - _values(\*columns) is given a list of column
         expressions, and returns a new Query that only
         returns those columns. When evaluated, the return
         value is a list of tuples just like when using
         :tickets: 
 
       query.order_by() and query.group_by() will accept
-      multiple arguments using *args (like select()
+      multiple arguments using \*args (like select()
       already does).
 
     .. change::
         :tags: ext
         :tickets: 
 
-      '+', '*', '+=' and '*=' support for association
+      '+', '*', '+=' and '\*=' support for association
       proxied lists.
 
     .. change::
         :tickets: 
 
       added new flag to String and create_engine(),
-      assert_unicode=(True|False|'warn'|None). Defaults to `False` or `None` on
+      assert_unicode=(True|False|'warn'\|None). Defaults to `False` or `None` on
       create_engine() and String, `'warn'` on the Unicode type. When `True`,
       results in all unicode conversion operations raising an exception when a
       non-unicode bytestring is passed as a bind parameter. 'warn' results
         :tickets: 908
 
       mapped classes which extend "object" and do not provide an
-      __init__() method will now raise TypeError if non-empty *args
-      or **kwargs are present at instance construction time (and are
+      __init__() method will now raise TypeError if non-empty \*args
+      or \**kwargs are present at instance construction time (and are
       not consumed by any extensions such as the scoped_session mapper),
       consistent with the behavior of normal Python classes
 
         :tickets: 
 
       Improvements and fixes on Firebird reflection:
-      . FBDialect now mimics OracleDialect, regarding case-sensitivity of TABLE and
-        COLUMN names (see 'case_sensitive remotion' topic on this current file).
-      . FBDialect.table_names() doesn't bring system tables (ticket:796).
-      . FB now reflects Column's nullable property correctly.
+        * FBDialect now mimics OracleDialect, regarding case-sensitivity of TABLE and
+          COLUMN names (see 'case_sensitive remotion' topic on this current file).
+        * FBDialect.table_names() doesn't bring system tables (ticket:796).
+        * FB now reflects Column's nullable property correctly.
 
     .. change::
         :tags: 
         :tags: 
         :tickets: 
 
-      Changed the API for the in_ operator. in_() now accepts a single argument
+      Changed the API for the in\_ operator. in_() now accepts a single argument
       that is a sequence of values or a selectable. The old API of passing in
       values as varargs still works but is deprecated.
 
         :tags: 
         :tickets: 
 
-      Tidied up what ends up in your namespace when you 'from sqlalchemy import *':
+      Tidied up what ends up in your namespace when you 'from sqlalchemy import \*':
 
     .. change::
         :tags: 
       is represented by more than one column, when using the ORM.  Objects of
       the new type are fully functional in query expressions, comparisons,
       query.get() clauses, etc. and act as though they are regular single-column
-      scalars... except they're not!  Use the function composite(cls, *columns)
+      scalars... except they're not!  Use the function composite(cls, \*columns)
       inside of the mapper's "properties" dict, and instances of cls will be
       created/mapped to a single attribute, comprised of the values correponding
-      to *columns.
+      to \*columns.
 
     .. change::
         :tags: orm
         :tickets: 
 
       All "type" keyword arguments, such as those to bindparam(), column(),
-      Column(), and func.<something>(), renamed to "type_".  Those objects still
+      Column(), and func.<something>(), renamed to "type\_".  Those objects still
       name their "type" attribute as "type".
 
     .. change::
index 0bcc1aa3f1963f55ab3e34534892703de94e52e5..debcc29fd4c5d51a63453cab3ecf934403cf4a49 100644 (file)
 
       Session.scalar() now converts raw SQL strings to text()
       the same way Session.execute() does and accepts same
-      alternative **kw args.
+      alternative \**kw args.
 
     .. change::
         :tags: orm
         :tickets: 
 
       ColumnProperty (and front-end helpers such as ``deferred``) no
-      longer ignores unknown **keyword arguments.
+      longer ignores unknown \**keyword arguments.
 
     .. change::
         :tags: orm
         :tags: orm
         :tickets: 
 
-      The RowTuple object returned by Query(*cols) now features
+      The RowTuple object returned by Query(\*cols) now features
       keynames which prefer mapped attribute names over column keys,
       column keys over column names, i.e.  Query(Class.foo,
       Class.bar) will have names "foo" and "bar" even if those are
         :tickets: 1140
 
       class.someprop.in_() raises NotImplementedError pending the
-      implementation of "in_" for relation
+      implementation of "in\_" for relation
 
     .. change::
         :tags: orm
 
       Unicode, UnicodeText types now set "assert_unicode" and
       "convert_unicode" by default, but accept overriding
-      **kwargs for these values.
+      \**kwargs for these values.
 
     .. change::
         :tags: sql
index c7f4dcdeaa96ce57b3d160df9cd596f0474cd0be..18d61019aacacd2c9f2031a3e4eecb40b5708274 100644 (file)
       New Query methods: query.label(name), query.as_scalar(),
       return the query's statement as a scalar subquery
       with /without label;
-      query.with_entities(*ent), replaces the SELECT list of
+      query.with_entities(\*ent), replaces the SELECT list of
       the query with new entities.
       Roughly equivalent to a generative form of query.values()
       which accepts mapped entities as well as column
         :tags: sql
         :tickets: 
 
-      Added type_coerce(expr, type_) expression element.
+      Added type_coerce(expr, type\_) expression element.
       Treats the given expression as the given type when evaluating
       expressions and processing result rows, but does not
       affect the generation of SQL, other than an anonymous
         :tags: orm
         :tickets: 
 
-      Query gains an add_columns(*columns) method which is a multi-
+      Query gains an add_columns(\*columns) method which is a multi-
       version of add_column(col).  add_column(col) is future
       deprecated.
 
         :tags: declarative
         :tickets: 
 
-      DeclarativeMeta exclusively uses cls.__dict__ (not dict_)
+      DeclarativeMeta exclusively uses cls.__dict__ (not dict\_)
       as the source of class information; _as_declarative exclusively
-      uses the  dict_ passed to it as the source of class information
+      uses the  dict\_ passed to it as the source of class information
       (which when using DeclarativeMeta is cls.__dict__).  This should
       in theory make it easier for custom metaclasses to modify
       the state passed into _as_declarative.
        * Passing a single list of elements to eagerload(),
          eagerload_all(), contains_eager(), lazyload(),
          defer(), and undefer() instead of multiple positional
-         *args is deprecated.
+         \*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.
+         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
       "expr != expr" can be very expensive, and it's preferred
       that the user not issue in_() if the list is empty,
       instead simply not querying, or modifying the criterion
-       as appropriate for more complex situations.
+      as appropriate for more complex situations.
 
     .. change::
         :tags: sql
         * the "connection" argument from engine.transaction() and
           engine.run_callable() is removed - Connection itself
           now has those methods.   All four methods accept
-          *args and **kwargs which are passed to the given callable,
+          \*args and \**kwargs which are passed to the given callable,
           as well as the operating connection.
 
     .. change::
 
       Removed public mutability from Index and Constraint
       objects:
-        - ForeignKeyConstraint.append_element()
-        - Index.append_column()
-        - UniqueConstraint.append_column()
-        - PrimaryKeyConstraint.add()
-        - PrimaryKeyConstraint.remove()
+
+        * ForeignKeyConstraint.append_element()
+        * Index.append_column()
+        * UniqueConstraint.append_column()
+        * PrimaryKeyConstraint.add()
+        * PrimaryKeyConstraint.remove()
+
       These should be constructed declaratively (i.e. in one
       construction).
 
       The signature of the "on" callable passed to DDL() and
       DDLElement() is revised as follows:
       
-        "ddl" - the DDLElement object itself.
-        "event" - the string event name.
-        "target" - previously "schema_item", the Table or
-        MetaData object triggering the event.
-        "connection" - the Connection object in use for the operation.
-        **kw - keyword arguments.  In the case of MetaData before/after
-          create/drop, the list of Table objects for which
-          CREATE/DROP DDL is to be issued is passed as the kw
-          argument "tables". This is necessary for metadata-level
-          DDL that is dependent on the presence of specific tables.
+        ddl
+            the DDLElement object itself
+        event
+            the string event name.
+        target
+            previously "schema_item", the Table or MetaData object triggering the event.
+        connection
+            the Connection object in use for the operation.
+        \**kw
+            keyword arguments.  In the case of MetaData before/after
+            create/drop, the list of Table objects for which
+            CREATE/DROP DDL is to be issued is passed as the kw
+            argument "tables". This is necessary for metadata-level
+            DDL that is dependent on the presence of specific tables.
       
-      - the "schema_item" attribute of DDL has been renamed to
+      The "schema_item" attribute of DDL has been renamed to
         "target".
 
     .. change::
index f658a7d87edc01ebbee277c1e3654ee3bf8fc84d..655c9b288b215ec24e9f99d085734c91da6f0cef 100644 (file)
@@ -11,7 +11,7 @@
         :tickets: 2851
         :versions: 0.8.3, 0.9.0
 
-        The regexp used by the :func:`.url.make_url` function now parses
+        The regexp used by the :func:`~.sqlalchemy.engine.url.make_url` function now parses
         ipv6 addresses, e.g. surrounded by brackets.
 
     .. change::
         :tickets:
 
       Added some decent context managers
-      to Engine, Connection:
+      to Engine, Connection::
 
           with engine.begin() as conn:
               <work with conn in a transaction>
 
-      and:
+      and::
 
           with engine.connect() as conn:
               <work with conn>
       polymorphic_on now accepts many
       new kinds of values:
 
-        - standalone expressions that aren't
+        * standalone expressions that aren't
           otherwise mapped
-        - column_property() objects
-        - string names of any column_property()
+        * column_property() objects
+        * string names of any column_property()
           or attribute name of a mapped Column
 
       The docs include an example using
 
       Enhanced the instrumentation in the ORM to support
       Py3K's new argument style of "required kw arguments",
-      i.e. fn(a, b, *, c, d), fn(a, b, *args, c, d).
+      i.e. fn(a, b, \*, c, d), fn(a, b, \*args, c, d).
       Argument signatures of mapped object's __init__
       method will be preserved, including required kw rules.
 
 
       Fixed a variety of synonym()-related regressions
       from 0.6:
-          - making a synonym against a synonym now works.
-          - synonyms made against a relationship() can
+
+          * making a synonym against a synonym now works.
+          * synonyms made against a relationship() can
             be passed to query.join(), options sent
             to query.options(), passed by name
             to query.with_parent().
         :tickets: 2239
 
       New declarative features:
-          - __declare_last__() method, establishes an event
-          listener for the class method that will be called
-          when mappers are completed with the final "configure"
-          step.
-          - __abstract__ flag.   The class will not be mapped
-          at all when this flag is present on the class.
-          - New helper classes ConcreteBase, AbstractConcreteBase.
-          Allow concrete mappings using declarative which automatically
-          set up the "polymorphic_union" when the "configure"
-          mapper step is invoked.
-          - The mapper itself has semi-private methods that allow
-          the "with_polymorphic" selectable to be assigned
-          to the mapper after it has already been configured.
+
+          * __declare_last__() method, establishes an event
+            listener for the class method that will be called
+            when mappers are completed with the final "configure"
+            step.
+          * __abstract__ flag.   The class will not be mapped
+            at all when this flag is present on the class.
+          * New helper classes ConcreteBase, AbstractConcreteBase.
+            Allow concrete mappings using declarative which automatically
+            set up the "polymorphic_union" when the "configure"
+            mapper step is invoked.
+          * The mapper itself has semi-private methods that allow
+            the "with_polymorphic" selectable to be assigned
+            to the mapper after it has already been configured.
 
     .. change::
         :tags: orm
         :tickets: 2206
 
       Fixed bug whereby adaptation of old append_ddl_listener()
-      function was passing unexpected **kw through
+      function was passing unexpected \**kw through
       to the Table event.   Table gets no kws, the MetaData
       event in 0.6 would get "tables=somecollection",
       this behavior is preserved.
         :tickets: 1069
 
       Query.distinct() now accepts column expressions
-      as *args, interpreted by the Postgresql dialect
+      as \*args, interpreted by the Postgresql dialect
       as DISTINCT ON (<expr>).
 
     .. change::
         :tickets: 1069
 
       select.distinct() now accepts column expressions
-      as *args, interpreted by the Postgresql dialect
+      as \*args, interpreted by the Postgresql dialect
       as DISTINCT ON (<expr>).  Note this was already
       available via passing a list to the `distinct`
       keyword argument to select().
         :tickets:
 
       select.prefix_with() accepts multiple expressions
-      (i.e. *expr), 'prefix' keyword argument to select()
+      (i.e. \*expr), 'prefix' keyword argument to select()
       accepts a list or tuple.
 
     .. change::
index 236bfc3ce1044af802ed2e18935829c9e04d903d..cb53534af0033981ede240af6493e2309df148c2 100644 (file)
@@ -749,10 +749,10 @@ Just like it says:
 
        b = bindparam('foo', type_=String)
 
-in_ Function Changed to Accept Sequence or Selectable
------------------------------------------------------
+in\_ Function Changed to Accept Sequence or Selectable
+------------------------------------------------------
 
-The in_ function now takes a sequence of values or a
+The in\_ function now takes a sequence of values or a
 selectable as its sole argument. The previous API of passing
 in values as positional arguments still works, but is now
 deprecated. This means that
index 5bc7e74aa9d334d9d9796e45400d0efc4b1e5a0f..95d6cb7db4a6e6c4ef8a21cfd9abd447bcf250ba 100644 (file)
@@ -288,8 +288,7 @@ events back to the owning parent or parents.   The extension
 includes an approach for scalar database values, such as
 those managed by ``PickleType``, ``postgresql.ARRAY``, or
 other custom ``MutableType`` classes, as well as an approach
-for ORM "composites", those configured using :ref:`composite()
-<mapper_composite>`_.
+for ORM "composites", those configured using :func:`~.sqlalchemy.orm.composite`.
 
 .. seealso::