From: Mike Bayer Date: Wed, 25 Jul 2007 23:36:31 +0000 (+0000) Subject: - removed the ridiculous AbstractDialect do-nothing class X-Git-Tag: rel_0_4_6~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51013961ba06c180c426516d7744b8a0c8747a48;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - removed the ridiculous AbstractDialect do-nothing class - fixup to docstrings --- diff --git a/doc/build/content/docstrings.html b/doc/build/content/docstrings.html index c0a9e1ac27..0f125cecfc 100644 --- a/doc/build/content/docstrings.html +++ b/doc/build/content/docstrings.html @@ -4,7 +4,7 @@ <%namespace name="formatting" file="formatting.html"/> <%namespace name="nav" file="nav.html"/> <%namespace name="pydoc" file="pydoc.html"/> -<%def name="title()">SQLAlchemy 0.3 Documentation - Modules and Classes +<%def name="title()">SQLAlchemy 0.4 Documentation - Modules and Classes <%! filename = 'docstrings' diff --git a/doc/build/gen_docstrings.py b/doc/build/gen_docstrings.py index de162d94b3..346497d3ec 100644 --- a/doc/build/gen_docstrings.py +++ b/doc/build/gen_docstrings.py @@ -3,10 +3,13 @@ import docstring import re from sqlalchemy import schema, types, ansisql, engine, sql, pool, orm, exceptions, databases +import sqlalchemy.orm.shard import sqlalchemy.ext.sessioncontext as sessioncontext import sqlalchemy.ext.selectresults as selectresults import sqlalchemy.ext.orderinglist as orderinglist import sqlalchemy.ext.associationproxy as associationproxy +import sqlalchemy.ext.assignmapper as assignmapper +import sqlalchemy.ext.sqlsoup as sqlsoup def make_doc(obj, classes=None, functions=None, **kwargs): """generate a docstring.ObjectDoc structure for an individual module, list of classes, and list of functions.""" @@ -19,6 +22,7 @@ def make_all_docs(): objects = [ make_doc(obj=sql,include_all_classes=True), make_doc(obj=schema), + make_doc(obj=pool), make_doc(obj=types), make_doc(obj=engine), make_doc(obj=engine.url), @@ -27,19 +31,21 @@ def make_all_docs(): make_doc(obj=engine.threadlocal), make_doc(obj=ansisql), make_doc(obj=orm), - make_doc(obj=orm.mapperlib, classes=[orm.mapperlib.MapperExtension, orm.mapperlib.Mapper]), - make_doc(obj=orm.interfaces), make_doc(obj=orm.collections, classes=[orm.collections.collection, orm.collections.MappedCollection, orm.collections.CollectionAdapter]), + make_doc(obj=orm.interfaces), + make_doc(obj=orm.mapperlib, classes=[orm.mapperlib.MapperExtension, orm.mapperlib.Mapper]), + make_doc(obj=orm.properties), make_doc(obj=orm.query, classes=[orm.query.Query, orm.query.QueryContext, orm.query.SelectionContext]), make_doc(obj=orm.session, classes=[orm.session.Session, orm.session.SessionTransaction]), + make_doc(obj=orm.shard), make_doc(obj=exceptions), - make_doc(obj=pool), - make_doc(obj=sessioncontext), - make_doc(obj=selectresults), - make_doc(obj=orderinglist, classes=[orderinglist.OrderingList]), + make_doc(obj=assignmapper), make_doc(obj=associationproxy, classes=[associationproxy.AssociationProxy]), + make_doc(obj=orderinglist, classes=[orderinglist.OrderingList]), + make_doc(obj=sessioncontext), + make_doc(obj=sqlsoup), ] + [make_doc(getattr(__import__('sqlalchemy.databases.%s' % m).databases, m)) for m in databases.__all__] return objects diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index ab6bd5619b..5cdb32a662 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -12,7 +12,7 @@ from sqlalchemy import exceptions, sql, schema, util, types, logging import StringIO, sys, re, random -class Dialect(sql.AbstractDialect): +class Dialect(object): """Define the behavior of a specific database/DBAPI. Any aspect of metadata definition, SQL query generation, execution, diff --git a/lib/sqlalchemy/orm/__init__.py b/lib/sqlalchemy/orm/__init__.py index b41d766c69..1982a94f78 100644 --- a/lib/sqlalchemy/orm/__init__.py +++ b/lib/sqlalchemy/orm/__init__.py @@ -41,10 +41,10 @@ def relation(argument, secondary=None, **kwargs): secondary for a many-to-many relationship, specifies the intermediary table. The - `secondary` keyword argument should generally only be used for a table + ``secondary`` keyword argument should generally only be used for a table that is not otherwise expressed in any class mapping. In particular, using the Association Object Pattern is - generally mutually exclusive against using the `secondary` keyword + generally mutually exclusive against using the ``secondary`` keyword argument. \**kwargs follow: @@ -55,14 +55,13 @@ def relation(argument, secondary=None, **kwargs): relationship. SA can now automatically reconcile a "delete" and "insert" operation of two objects with the same "identity" in a flush() operation into a single "update" statement, which is the pattern that - "association" used to indicate. See the updated example of association - mappings in [datamapping_association](rel:datamapping_association). + "association" used to indicate. backref indicates the name of a property to be placed on the related mapper's class that will handle this relationship in the other direction, including synchronizing the object attributes on both sides of the - relation. Can also point to a `backref()` construct for more + relation. Can also point to a ``backref()`` construct for more configurability. cascade @@ -76,17 +75,17 @@ def relation(argument, secondary=None, **kwargs): foreign_keys a list of columns which are to be used as "foreign key" columns. this parameter should be used in conjunction with explicit - `primaryjoin` and `secondaryjoin` (if needed) arguments, and the - columns within the `foreign_keys` list should be present within - those join conditions. Normally, `relation()` will inspect the + ``primaryjoin`` and ``secondaryjoin`` (if needed) arguments, and the + columns within the ``foreign_keys`` list should be present within + those join conditions. Normally, ``relation()`` will inspect the columns within the join conditions to determine which columns are - the "foreign key" columns, based on information in the `Table` + the "foreign key" columns, based on information in the ``Table`` metadata. Use this argument when no ForeignKey's are present in the join condition, or to override the table-defined foreign keys. foreignkey - deprecated. use the `foreign_keys` argument for foreign key - specification, or `remote_side` for "directional" logic. + deprecated. use the ``foreign_keys`` argument for foreign key + specification, or ``remote_side`` for "directional" logic. lazy=True specifies how the related items should be loaded. a value of True @@ -104,10 +103,10 @@ def relation(argument, secondary=None, **kwargs): indicates the ordering that should be applied when loading these items. passive_deletes=False - Indicates if lazy-loaders should not be executed during the `flush()` + Indicates if lazy-loaders should not be executed during the ``flush()`` process, which normally occurs in order to locate all existing child items when a parent item is to be deleted. Setting this flag to True is - appropriate when `ON DELETE CASCADE` rules have been set up on the + appropriate when ``ON DELETE CASCADE`` rules have been set up on the actual tables so that the database may handle cascading deletes automatically. This strategy is useful particularly for handling the deletion of objects that have very large (and/or deep) child-object @@ -125,9 +124,9 @@ def relation(argument, secondary=None, **kwargs): that are dependent on each other, such as a table that has a one-to-many relationship to a set of child rows, and also has a column that references a single child row within that list (i.e. both tables - contain a foreign key to each other). If a `flush()` operation returns + contain a foreign key to each other). If a ``flush()`` operation returns an error that a "cyclical dependency" was detected, this is a cue that - you might want to use `post_update` to "break" the cycle. + you might want to use ``post_update`` to "break" the cycle. primaryjoin a ClauseElement that will be used as the primary join of this child @@ -137,8 +136,8 @@ def relation(argument, secondary=None, **kwargs): and child tables (or association table). private=False - deprecated. setting `private=True` is the equivalent of setting - `cascade="all, delete-orphan"`, and indicates the lifecycle of child + deprecated. setting ``private=True`` is the equivalent of setting + ``cascade="all, delete-orphan"``, and indicates the lifecycle of child objects should be contained within that of the parent. remote_side @@ -153,7 +152,7 @@ def relation(argument, secondary=None, **kwargs): uselist=(True|False) a boolean that indicates if this property should be loaded as a list or a scalar. In most cases, this value is determined automatically by - `relation()`, based on the type and direction of the relationship - one + ``relation()``, based on the type and direction of the relationship - one to many forms a list, many to one forms a scalar, many to many is a list. If a scalar is desired where normally a list would be present, such as a bi-directional one-to-one relationship, set uselist to False. @@ -212,7 +211,7 @@ def composite(class_, *cols, **kwargs): columns given, as well as a __colset__() method which returns its attributes in column order. - class_ + class\_ the "composite type" class. \*cols diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 39420c1801..28a503cc03 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -405,7 +405,7 @@ class Column(SchemaItem, sql._ColumnClause): The name of this column. This should be the identical name as it appears, or will appear, in the database. - type_ + type\_ The ``TypeEngine`` for this column. This can be any subclass of ``types.AbstractType``, including the database-agnostic types defined in the types module, diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 326fb93e56..c9847f6e29 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -28,7 +28,7 @@ from sqlalchemy import util, exceptions from sqlalchemy import types as sqltypes import re, operator -__all__ = ['AbstractDialect', 'Alias', 'ClauseElement', 'ClauseParameters', +__all__ = ['Alias', 'ClauseElement', 'ClauseParameters', 'ClauseVisitor', 'ColumnCollection', 'ColumnElement', 'CompoundSelect', 'Delete', 'FromClause', 'Insert', 'Join', 'Select', 'Selectable', 'TableClause', 'Update', 'alias', 'and_', 'asc', @@ -564,7 +564,7 @@ def literal(value, type_=None): the underlying DBAPI, or is translatable via the given type argument. - type + type\_ an optional [sqlalchemy.types#TypeEngine] which will provide bind-parameter translation for this literal. @@ -605,7 +605,7 @@ def column(text, type_=None): constructs that are not to be quoted, use the [sqlalchemy.sql#literal_column()] function. - type + type\_ an optional [sqlalchemy.types#TypeEngine] object which will provide result-set translation for this column. @@ -774,12 +774,6 @@ def _selectable(element): def is_column(col): return isinstance(col, ColumnElement) -class AbstractDialect(object): - """Represent the behavior of a particular database. - - Used by ``Compiled`` objects.""" - pass - class ClauseParameters(object): """Represent a dictionary/iterator of bind parameter key names/values. @@ -1855,7 +1849,7 @@ class _BindParamClause(ClauseElement, _CompareMixin): execution may match either the key or the shortname of the corresponding ``_BindParamClause`` objects. - type_ + type\_ A ``TypeEngine`` object that will be used to pre-process the value corresponding to this ``_BindParamClause`` at execution time.