[SQL-CVS] r4330 - SQLObject/trunk/docs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2011-01-26 15:19:38
|
Author: phd Date: Wed Jan 26 08:19:31 2011 New Revision: 4330 Log: Some single and double quotes were changed to reST literals (double backticks). Modified: SQLObject/trunk/docs/DeveloperGuide.txt SQLObject/trunk/docs/News.txt SQLObject/trunk/docs/SQLObject.txt SQLObject/trunk/docs/SelectResults.txt SQLObject/trunk/docs/TODO.txt Modified: SQLObject/trunk/docs/DeveloperGuide.txt ============================================================================== --- SQLObject/trunk/docs/DeveloperGuide.txt Wed Jan 26 07:34:09 2011 (r4329) +++ SQLObject/trunk/docs/DeveloperGuide.txt Wed Jan 26 08:19:31 2011 (r4330) @@ -151,10 +151,10 @@ .. __: http://codespeak.net/py/current/doc/test.html .. _getting started: http://codespeak.net/py/dist/test.html#starting-point-py-test-command-line-tool -To actually run the test, you have to give it a database to connect -to. You do so with the option "-D". You can either give a complete URI or one of several -shortcuts like ``mysql`` (these shortcuts are defined in the top of -``tests/dbtest.py``). +To actually run the test, you have to give it a database to connect to. +You do so with the option ``-D``. You can either give a complete URI or +one of several shortcuts like ``mysql`` (these shortcuts are defined in +the top of ``tests/dbtest.py``). All the tests are modules in ``sqlobject/tests``. Each module tests one kind of feature, more or less. If you are testing a module, call Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Wed Jan 26 07:34:09 2011 (r4329) +++ SQLObject/trunk/docs/News.txt Wed Jan 26 08:19:31 2011 (r4330) @@ -13,7 +13,8 @@ Features & Interface -------------------- -* Parameter 'backend' in DB URI is no longer supported, use parameter 'driver'. +* Parameter ``backend`` in DB URI is no longer supported, use parameter + ``driver``. SQLObject 0.15.1 ================ @@ -67,7 +68,7 @@ value True; this means the default schema parser is now based on ``PRAGMA table_info()``. -* Major API change: attribute 'dirty' was moved to sqlmeta. +* Major API change: attribute ``dirty`` was moved to sqlmeta. SQLObject 0.13.1 ================ @@ -114,7 +115,7 @@ * Renamed db_encoding to dbEncoding in UnicodeStringValidator. -* A new parameter 'sslmode' was added to PostgresConnection. +* A new parameter ``sslmode`` was added to PostgresConnection. * Removed SQLValidator - its attemptConvert was never called because in FormEncode it's named attempt_convert. @@ -122,8 +123,9 @@ SQLObject 0.12.5 ================ -* 'backend' parameter was renamed to 'driver'. To preserve backward - compatibility 'backend' is recognized and will be recognized for some time. +* ``backend`` parameter was renamed to ``driver``. To preserve backward + compatibility ``backend`` is still recognized and will be recognized + for some time. SQLObject 0.12.4 ================ @@ -168,29 +170,30 @@ * .selectBy(), .deleteBy() and .by*() methods pass all values through .from_python(), not only unicode. -* The user can choose a DB API driver for SQLite by using a "backend" +* The user can choose a DB API driver for SQLite by using a ``backend`` parameter in DB URI or SQLiteConnection that can be a comma-separated - list of backend names. Possible backends are: "pysqlite2" (alias - "sqlite2"), "sqlite3", "sqlite" (alias "sqlite1"). Default is to test - pysqlite2, sqlite3 and sqlite in that order. + list of backend names. Possible backends are: ``pysqlite2`` (alias + ``sqlite2``), ``sqlite3``, ``sqlite`` (alias ``sqlite1``). Default is + to test pysqlite2, sqlite3 and sqlite in that order. -* The user can choose a DB API driver for PostgreSQL by using a "backend" +* The user can choose a DB API driver for PostgreSQL by using a ``backend`` parameter in DB URI or PostgresConnection that can be a comma-separated - list of backend names. Possible backends are: "psycopg2", "psycopg1", - "psycopg" (tries psycopg2 and psycopg1), "pygresql". Default is - "psycopg". + list of backend names. Possible backends are: ``psycopg2``, ``psycopg1``, + ``psycopg`` (tries psycopg2 and psycopg1), ``pygresql``. Default is + ``psycopg``. WARNING: API change! PostgresConnection's parameter - "usePygresql" is now replaced with "backend=pygresql". + ``usePygresql`` is now replaced with ``backend=pygresql``. -* The user can choose a DB API driver for MSSQL by using a "backend" - parameter in DB URI or MSSQLConnection that can be a comma-separated list - of backend names. Possible backends are: "adodb" (alias "adodbapi") and - "pymssql". Default is to test adodbapi and pymssql in that order. +* The user can choose a DB API driver for MSSQL by using a ``backend`` + parameter in DB URI or MSSQLConnection that can be a comma-separated + list of backend names. Possible backends are: ``adodb`` (alias + ``adodbapi``) and ``pymssql``. Default is to test adodbapi and pymssql + in that order. * alternateMethodName is defined for all unique fields, not only alternateID; this makes SQLObject create .by*() methods for all unique fields. -* SET client_encoding for PostgreSQL to the value of "charset" parameter +* SET client_encoding for PostgreSQL to the value of ``charset`` parameter in DB URI or PostgresConnection. * TimestampCol() can be instantiated without any defaults, in this case @@ -286,8 +289,9 @@ * Dropped support for PostgreSQL 7.2. The minimal supported version of PostgreSQL is 7.3 now. -* New magic attribute 'j' similar to 'q' was added that automagically does - join with the other table in MultipleJoin or RelatedJoin. +* New magic attribute ``j`` similar to ``q`` was added that + automagically does join with the other table in MultipleJoin or + RelatedJoin. * SQLObject can now create and drop a database in MySQL, PostgreSQL, SQLite and Firebird/Interbase. Modified: SQLObject/trunk/docs/SQLObject.txt ============================================================================== --- SQLObject/trunk/docs/SQLObject.txt Wed Jan 26 07:34:09 2011 (r4329) +++ SQLObject/trunk/docs/SQLObject.txt Wed Jan 26 08:19:31 2011 (r4330) @@ -477,7 +477,7 @@ Person.q.firstName=="John" -converts it to the string "first_name = 'John'" and passes the string to +converts it to the string ``first_name = 'John'`` and passes the string to the backend. selectBy Method @@ -1279,17 +1279,17 @@ .. _`Multiple Join Keywords`: `joinColumn`: - The column name of the key that points to this table. So, if you have - a table ``Product``, and another table has a column ``ProductNo`` that - points to this table, then you'd use ``joinColumn="ProductNo"``. - WARNING: the argument you pass must conform to the column name in the - database, not to the column in the class. So, if you have a SQLObject - containing the 'ProductNo' column, this will probably be translated - into 'product_no_id' in the DB ( product_no is the normal uppercase- - to-lowercase + underscores SQLO Translation, the added _id is just - because the column referring to the table is probably a ForeignKey, - and SQLO translates foreign keys that way). - You should pass that parameter. + The column name of the key that points to this table. So, if you + have a table ``Product``, and another table has a column + ``ProductNo`` that points to this table, then you'd use + ``joinColumn="ProductNo"``. WARNING: the argument you pass must + conform to the column name in the database, not to the column in the + class. So, if you have a SQLObject containing the ``ProductNo`` + column, this will probably be translated into ``product_no_id`` in + the DB (``product_no`` is the normal uppercase- to-lowercase + + underscores SQLO Translation, the added _id is just because the + column referring to the table is probably a ForeignKey, and SQLO + translates foreign keys that way). You should pass that parameter. `orderBy`: Like the `orderBy`_ argument to `select()`, you can specify the order that the joined objects should be returned in. `defaultOrder` @@ -1407,9 +1407,10 @@ database connection, and `commit` and `rollback` just pass that message to the low-level connection. -One can call as much .commit()'s, but after a .rollback() one has to call -.begin(). The last .commit() should be called as .commit(close=True) to -release low-level connection back to the connection pool. +One can call as much ``.commit()``'s, but after a ``.rollback()`` one +has to call ``.begin()``. The last ``.commit()`` should be called as +``.commit(close=True)`` to release low-level connection back to the +connection pool. You can use SELECT FOR UPDATE in those databases that support it:: @@ -1563,7 +1564,7 @@ should be used to map the table column name to SQLObject id column. If the Primary Key consists only of number columns it is possible to create a -virtual column "id" this way: +virtual column ``id`` this way: Example for Postgresql: @@ -1592,7 +1593,7 @@ Caveats: -* this way the "id" may become a very large integer number which may cause +* this way the ``id`` may become a very large integer number which may cause troubles elsewhere. * no performance loss takes place if the where clauses specifies the PK @@ -1619,7 +1620,7 @@ Other styles exist. A typical one is mixed case column names, and a primary key that includes the table name, like ``ProductID``. You can -use a different "Style" object to indicate a different naming +use a different `Style` object to indicate a different naming convention. For instance:: class Person(SQLObject): @@ -1674,13 +1675,14 @@ true, then any SQL sent to the database will also be printed to the console. -You can additionally pass `logger` keyword argument which should be a name -of the logger to use. If specified and `debug` is ``True``, SQLObject will -write debug print statements via that logger instead of printing directly -to console. The argument `loglevel` allows to choose the logging level - it -can be "debug", "info", "warning", "error", "critical" or "exception". In -case `logger` is empty or absent SQLObject uses prints instead of logging; -`loglevel` can be "stdout" or "stderr" in this case; default is "stdout". +You can additionally pass `logger` keyword argument which should be a +name of the logger to use. If specified and `debug` is ``True``, +SQLObject will write debug print statements via that logger instead of +printing directly to console. The argument `loglevel` allows to choose +the logging level - it can be ``debug``, ``info``, ``warning``, +``error``, ``critical`` or ``exception``. In case `logger` is absent or +empty SQLObject uses ``print``'s instead of logging; `loglevel` can be +``stdout`` or ``stderr`` in this case; default is ``stdout``. To configure logging one can do something like that:: @@ -1711,7 +1713,7 @@ does not have support for explicitly defining the backend when using ``createTable``. -Keyword argument "conv" allows to pass a list of custom converters. +Keyword argument ``conv`` allows to pass a list of custom converters. Example:: import time @@ -1744,10 +1746,11 @@ PostgresConnection supports transactions and all other features. -The user can choose a DB API driver for PostgreSQL by using a "driver" +The user can choose a DB API driver for PostgreSQL by using a ``driver`` parameter in DB URI or PostgresConnection that can be a comma-separated -list of driver names. Possible drivers are: "psycopg2", "psycopg1", -"psycopg" (tries psycopg2 and psycopg1), "pygresql". Default is "psycopg". +list of driver names. Possible drivers are: ``psycopg2``, ``psycopg1``, +``psycopg`` (tries psycopg2 and psycopg1), ``pygresql``. Default is +``psycopg``. SQLite ------ @@ -1763,10 +1766,10 @@ SQLite may have concurrency issues, depending on your usage in a multi-threaded environment. -The user can choose a DB API driver for SQLite by using a "driver" +The user can choose a DB API driver for SQLite by using a ``driver`` parameter in DB URI or SQLiteConnection that can be a comma-separated list -of driver names. Possible drivers are: "pysqlite2" (alias "sqlite2"), -"sqlite3", "sqlite" (alias "sqlite1"). Default is to test pysqlite2, +of driver names. Possible drivers are: ``pysqlite2`` (alias ``sqlite2``), +``sqlite3``, ``sqlite`` (alias ``sqlite1``). Default is to test pysqlite2, sqlite3 and sqlite in that order. Firebird @@ -1852,15 +1855,15 @@ SQL Server on a "named" port, make sure to specify the port number in the URI. -The two drivers currently supported are pymssql_ and adodbapi_. +The two drivers currently supported are adodbapi_ and pymssql_. -.. _pymssql: http://pymssql.sourceforge.net/ .. _adodbapi: http://adodbapi.sourceforge.net/ +.. _pymssql: http://pymssql.sourceforge.net/ -The user can choose a DB API driver for MSSQL by using a "driver" +The user can choose a DB API driver for MSSQL by using a ``driver`` parameter in DB URI or MSSQLConnection that can be a comma-separated list -of driver names. Possible drivers are: "adodb" (alias "adodbapi") and -"pymssql". Default is to test adodbapi and pymssql in that order. +of driver names. Possible drivers are: ``adodb`` (alias ``adodbapi``) and +``pymssql``. Default is to test ``adodbapi`` and ``pymssql`` in that order. Events (signals) ================ @@ -2043,9 +2046,9 @@ Select() is used instead of .select() because you need to control what columns the inner query returns. -Available queries are IN(), NOTIN(), EXISTS(), NOTEXISTS(), SOME(), ANY() -and ALL(). The last 3 are used with comparison operators, like this: -"somevalue = ANY(Select(...))". +Available queries are ``IN()``, ``NOTIN()``, ``EXISTS()``, +``NOTEXISTS()``, ``SOME()``, ``ANY()`` and ``ALL()``. The last 3 are +used with comparison operators, like this: ``somevalue = ANY(Select(...))``. Utilities --------- Modified: SQLObject/trunk/docs/SelectResults.txt ============================================================================== --- SQLObject/trunk/docs/SelectResults.txt Wed Jan 26 07:34:09 2011 (r4329) +++ SQLObject/trunk/docs/SelectResults.txt Wed Jan 26 08:19:31 2011 (r4330) @@ -191,7 +191,7 @@ Person.select(Person.q.name=='Steve').throughTo.father.throughTo.father returns a SelectResult of Persons who are the paternal grandfather of someone -named 'Steve'. +named ``Steve``. .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject Modified: SQLObject/trunk/docs/TODO.txt ============================================================================== --- SQLObject/trunk/docs/TODO.txt Wed Jan 26 07:34:09 2011 (r4329) +++ SQLObject/trunk/docs/TODO.txt Wed Jan 26 08:19:31 2011 (r4330) @@ -26,7 +26,7 @@ tableParamSQL = 'ENGINE InnoDB' tableParamSQL = {'mysql': 'ENGINE InnoDB'} -* List tables in the DB. The query in MySQL is 'SHOW TABLES'; in SQLite it is +* List tables in the DB. The query in MySQL is ``SHOW TABLES``; in SQLite it is SELECT name FROM sqlite_master WHERE type='table' ORDER BY name @@ -54,7 +54,7 @@ * Cache columns in sqlmeta.getColumns(); reset the cache on add/Del Column/Join. -* Stop supporting Python 2.4: use 'with lock'; use hashlib instead of md5. +* Stop supporting Python 2.4: use ``with lock``; use hashlib instead of md5. * Stop supporting Python 2.5: remove import sets. |