]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
additoinal
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Aug 2013 22:16:40 +0000 (18:16 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 21 Aug 2013 21:08:08 +0000 (17:08 -0400)
cherry pick of 9302be39a5f40b537ff43e1990c7a210c464cf1c from 0.9
Conflicts:
lib/sqlalchemy/sql/selectable.py

doc/build/builder/autodoc_mods.py
lib/sqlalchemy/sql/expression.py

index 04afb03a7900873023512ee14d63a66ec9372bff..25d1398647ff140237c20e4ff05d71b02f341ecb 100644 (file)
@@ -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]
index ce7322b9d2024bcdd07269df73ffb2dc2c044d2f..b2f957bd02e0f8b2feef48d3adf80bf9d013b36b 100644 (file)
@@ -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'