diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-18 18:16:40 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-21 17:08:08 -0400 |
commit | 822b85d114b4252a0b52a9efdd41ce89d0fb8d06 (patch) | |
tree | 06f3ede9b20c19a7e0acc8837e67934b5482e933 | |
parent | 944f99a3b1d887feb1f36b1ffe2fc3f2101bd460 (diff) | |
download | sqlalchemy-822b85d114b4252a0b52a9efdd41ce89d0fb8d06.tar.gz |
additoinal
cherry pick of 9302be39a5f40b537ff43e1990c7a210c464cf1c from 0.9
Conflicts:
lib/sqlalchemy/sql/selectable.py
-rw-r--r-- | doc/build/builder/autodoc_mods.py | 42 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/expression.py | 20 |
2 files changed, 44 insertions, 18 deletions
diff --git a/doc/build/builder/autodoc_mods.py b/doc/build/builder/autodoc_mods.py index 04afb03a7..25d139864 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 ce7322b9d..b2f957bd0 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' |