[SQL-CVS] r1152 - SQLObject/trunk/docs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-10-27 16:20:26
|
Author: ianb Date: 2005-10-27 16:20:12 +0000 (Thu, 27 Oct 2005) New Revision: 1152 Modified: SQLObject/trunk/docs/sqlobject-admin.txt Log: added an example of using createSQL Modified: SQLObject/trunk/docs/sqlobject-admin.txt =================================================================== --- SQLObject/trunk/docs/sqlobject-admin.txt 2005-10-27 16:03:44 UTC (rev 1151) +++ SQLObject/trunk/docs/sqlobject-admin.txt 2005-10-27 16:20:12 UTC (rev 1152) @@ -94,6 +94,18 @@ This finds the tables and creates them. Any tables that exist are simply skipped. +It also collects data from sqlmeta.createSQL and runs the queries +after table creation. createSQL can be a string with a single SQL +command, a list of SQL commands, or a dictionary with keys that are +dbNames and values that are either single SQL command string or a list +of SQL commands. An example follows: + +:: + class MyTable(SQLObject): + class sqlmeta: + createSQL = {'postgres': ["ALTER TABLE my_table ADD CHECK(my_field != '');"]} + myField = StringCol() + The ``sql`` Command ------------------- |