From: Mike Bayer Date: Sun, 18 Aug 2013 22:16:40 +0000 (-0400) Subject: additoinal X-Git-Tag: rel_0_8_3~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=822b85d114b4252a0b52a9efdd41ce89d0fb8d06;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git additoinal cherry pick of 9302be39a5f40b537ff43e1990c7a210c464cf1c from 0.9 Conflicts: lib/sqlalchemy/sql/selectable.py --- diff --git a/doc/build/builder/autodoc_mods.py b/doc/build/builder/autodoc_mods.py index 04afb03a79..25d1398647 100644 --- a/doc/build/builder/autodoc_mods.py +++ b/doc/build/builder/autodoc_mods.py @@ -10,17 +10,26 @@ def autodoc_skip_member(app, what, name, obj, skip, options): return skip -def _adjust_rendered_mod_name(modname, objname): - modname = modname.replace("sqlalchemy.sql.sqltypes", "sqlalchemy.types") - modname = modname.replace("sqlalchemy.sql.type_api", "sqlalchemy.types") - modname = modname.replace("sqlalchemy.sql.schema", "sqlalchemy.schema") - modname = modname.replace("sqlalchemy.sql.elements", "sqlalchemy.sql.expression") - modname = modname.replace("sqlalchemy.sql.selectable", "sqlalchemy.sql.expression") - modname = modname.replace("sqlalchemy.sql.dml", "sqlalchemy.sql.expression") - modname = modname.replace("sqlalchemy.sql.ddl", "sqlalchemy.schema") - modname = modname.replace("sqlalchemy.sql.base", "sqlalchemy.sql.expression") +_convert_modname = { + "sqlalchemy.sql.sqltypes": "sqlalchemy.types", + "sqlalchemy.sql.type_api": "sqlalchemy.types", + "sqlalchemy.sql.schema": "sqlalchemy.schema", + "sqlalchemy.sql.elements": "sqlalchemy.sql.expression", + "sqlalchemy.sql.selectable": "sqlalchemy.sql.expression", + "sqlalchemy.sql.dml": "sqlalchemy.sql.expression", + "sqlalchemy.sql.ddl": "sqlalchemy.schema", + "sqlalchemy.sql.base": "sqlalchemy.sql.expression" +} + +_convert_modname_w_class = { + ("sqlalchemy.engine.interfaces", "Connectable"): "sqlalchemy.engine" +} - return modname +def _adjust_rendered_mod_name(modname, objname): + if modname in _convert_modname: + return _convert_modname[modname] + elif (modname, objname) in _convert_modname_w_class: + return _convert_modname_w_class[(modname, objname)] # im sure this is in the app somewhere, but I don't really # know where, so we're doing it here. @@ -30,6 +39,9 @@ def autodoc_process_docstring(app, what, name, obj, options, lines): if what == "class": _track_autodoced[name] = obj + # need to translate module names for bases, others + # as we document lots of symbols in namespace modules + # outside of their source bases = [] for base in obj.__bases__: if base is not object: @@ -38,11 +50,10 @@ def autodoc_process_docstring(app, what, name, obj, options, lines): base.__name__)) if bases: - lines.insert(0, - "Bases: %s" % ( - ", ".join(bases) - )) - lines.insert(1, "") + lines[:0] = [ + "Bases: %s" % (", ".join(bases)), + "" + ] elif what in ("attribute", "method") and \ @@ -74,7 +85,6 @@ def autodoc_process_docstring(app, what, name, obj, options, lines): "" ] -from docutils import nodes def missing_reference(app, env, node, contnode): if node.attributes['reftarget'] in _inherited_names: return node.children[0] diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index ce7322b9d2..b2f957bd02 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -4702,7 +4702,7 @@ class TableClause(Immutable, FromClause): class SelectBase(Executable, FromClause): - """Base class for :class:`.Select` and ``CompoundSelects``.""" + """Base class for :class:`.Select` and :class:`.CompoundSelect`.""" _order_by_clause = ClauseList() _group_by_clause = ClauseList() @@ -5021,7 +5021,23 @@ class ScalarSelect(Generative, Grouping): class CompoundSelect(SelectBase): """Forms the basis of ``UNION``, ``UNION ALL``, and other - SELECT-based set operations.""" + SELECT-based set operations. + + .. seealso:: + + :func:`.union` + + :func:`.union_all` + + :func:`.intersect` + + :func:`.intersect_all` + + :func:`.except` + + :func:`.except_all` + + """ __visit_name__ = 'compound_select'