]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
doc
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Oct 2005 04:42:52 +0000 (04:42 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Oct 2005 04:42:52 +0000 (04:42 +0000)
doc/build/content/datamapping.myt
doc/build/content/metadata.myt

index 6e701de295641e541b6a45c2415cbab0ab4e543b..871e5ed08fe7574fe28c474a74ce72368d5359e4 100644 (file)
@@ -53,7 +53,7 @@ password=:password WHERE users.user_id = :user_id
         # second table <& formatting.myt:link, path="metadata", text="metadata" &>
         addresses = Table('email_addresses', engine,
             Column('address_id', Integer, primary_key = True),
-            Column('user_id', Integer, foreign_key = ForeignKey(users.c.user_id)),
+            Column('user_id', Integer, ForeignKey("users.user_id")),
             Column('email_address', String(20)),
         )
         
@@ -134,7 +134,7 @@ VALUES (:address_id, :user_id, :email_address)
             Column('user_id', Integer, primary_key = True),
             Column('user_name', String(16), nullable = False),
             Column('password', String(20), nullable = False),
-            Column('preference_id', Integer, foreign_key = ForeignKey(prefs.c.pref_id))
+            Column('preference_id', Integer, ForeignKey("prefs.pref_id"))
         )
         
         # class definition for preferences
@@ -195,8 +195,8 @@ VALUES (:address_id, :user_id, :email_address)
     )
 
     itemkeywords = Table('article_keywords', engine,
-        Column('article_id', Integer, ForeignKey(articles.c.article_id)),
-        Column('keyword_id', Integer, ForeignKey(keywords.c.keyword_id))
+        Column('article_id', Integer, ForeignKey("articles.article_id")),
+        Column('keyword_id', Integer, ForeignKey("keywords.keyword_id"))
     )
 
     articles.create()
index d191332accde91e2a287559228604e29d04a3b22..09cd24aa1cbfe3d024d352bf091659f85c2d9508 100644 (file)
@@ -1,7 +1,7 @@
 <%flags>inherit='document_base.myt'</%flags>
 <&|doclib.myt:item, name="metadata", description="Database Meta Data" &>
     <&|doclib.myt:item, name="tables", description="Describing Tables with MetaData" &>
-    <p>The core of SQLAlchemy's query and object mapping operations is table metadata, which are Python objects that describe tables.  Metadata objects can be created by explicitly naming the table and all its properties, using the Table, Column, and ForeignKey objects: </p>
+    <p>The core of SQLAlchemy's query and object mapping operations is table metadata, which are Python objects that describe tables.  Metadata objects can be created by explicitly naming the table and all its properties, using the Table, Column, and ForeignKey objects imported from <span class="codeline">sqlalchemy.schema</span>, and datatype identifiers imported from <&formatting.myt:link, path="types", text="sqlalchemy.types"&>: </p>
         <&|formatting.myt:code&>
         from sqlalchemy.schema import *
         import sqlalchemy.sqlite as sqlite
@@ -16,7 +16,7 @@
         
         user_prefs = Table('user_prefs', engine, 
             Column('pref_id', Integer, primary_key = True),
-            Column('user_id', Integer, nullable = False, foreign_key = ForeignKey(users.c.user_id))
+            Column('user_id', Integer, nullable = False, ForeignKey("users.user_id"))
             Column('pref_name', String(40), nullable = False),
             Column('pref_value', String(100))
         )
     </&>
     <&|doclib.myt:item, name="building", description="Building and Dropping Database Tables" &>
     </&>
+
+    <&|doclib.myt:item, name="adapting", description="Adapting Tables to Alternate Engines" &>
+    </&>
+
+    <&|doclib.myt:item, name="sequences", description="Defining Sequences" &>
+    </&>
+
 </&>
\ No newline at end of file