From 36ab8bb2e03ccd8b55019681932f8cff72ea76ca Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 21 Oct 2005 04:42:52 +0000 Subject: [PATCH] doc --- doc/build/content/datamapping.myt | 8 ++++---- doc/build/content/metadata.myt | 11 +++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/build/content/datamapping.myt b/doc/build/content/datamapping.myt index 6e701de295..871e5ed08f 100644 --- a/doc/build/content/datamapping.myt +++ b/doc/build/content/datamapping.myt @@ -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() diff --git a/doc/build/content/metadata.myt b/doc/build/content/metadata.myt index d191332acc..09cd24aa1c 100644 --- a/doc/build/content/metadata.myt +++ b/doc/build/content/metadata.myt @@ -1,7 +1,7 @@ <%flags>inherit='document_base.myt' <&|doclib.myt:item, name="metadata", description="Database Meta Data" &> <&|doclib.myt:item, name="tables", description="Describing Tables with MetaData" &> -

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:

+

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 sqlalchemy.schema, and datatype identifiers imported from <&formatting.myt:link, path="types", text="sqlalchemy.types"&>:

<&|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)) ) @@ -59,4 +59,11 @@ <&|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 -- 2.47.2