[SQL-CVS] r2101 - SQLObject/branches/0.7-bugfix/docs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2006-11-20 19:31:52
|
Author: phd
Date: 2006-11-20 12:31:31 -0700 (Mon, 20 Nov 2006)
New Revision: 2101
Modified:
SQLObject/branches/0.7-bugfix/docs/FAQ.txt
Log:
Note should go first - a note in the end of a section floats to the next section.
Modified: SQLObject/branches/0.7-bugfix/docs/FAQ.txt
===================================================================
--- SQLObject/branches/0.7-bugfix/docs/FAQ.txt 2006-11-20 18:42:58 UTC (rev 2100)
+++ SQLObject/branches/0.7-bugfix/docs/FAQ.txt 2006-11-20 19:31:31 UTC (rev 2101)
@@ -107,6 +107,19 @@
How can I define my own intermediate table in my Many-to-Many relationship?
---------------------------------------------------------------------------
+.. note::
+ In User and Role, SQLRelatedJoin is used with createRelatedTable=False
+ so the intermediate table is not created automatically. We also set the
+ intermediate table name with intermediateTable='user_roles'.
+ UserRoles is the definition of our intermediate table.
+ UserRoles creates a unique index to make sure we don't have duplicate
+ data in the database.
+ We also added an extra field called active which has a boolean value.
+ The active column might be used to activate/deactivate a given role for
+ a user in this example.
+ Another common field to add in this an intermediate table might be a sort
+ field.
+
We'll expand on the User and Role example and define our own UserRoles class which
will be the intermediate table for the User and Role Many-to-Many relationship.
@@ -130,20 +143,7 @@
... active = BoolCol(notNull=True, default=False)
... unique = index.DatabaseIndex(user, role, unique=True)
-.. note::
- In User and Role, SQLRelatedJoin is used with createRelatedTable=False
- so the intermediate table is not created automatically. We also set the
- intermediate table name with intermediateTable='user_roles'.
- UserRoles is the definition of our intermediate table.
- UserRoles creates a unique index to make sure we don't have duplicate
- data in the database.
- We also added an extra field called active which has a boolean value.
- The active column might be used to activate/deactivate a given role for
- a user in this example.
- Another common field to add in this an intermediate table might be a sort
- field.
-
How Does Inheritance Work?
--------------------------
|