From b2adfe7c10bff8edd06a76df3c638768e30b6bc3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 4 Nov 2010 03:35:53 -0400 Subject: - The SQL Wiki tutorial was updated to take into account changes to the ``pyramid_routesalchemy`` paster template. --- docs/tutorials/wiki2/definingmodels.rst | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'docs/tutorials/wiki2/definingmodels.rst') diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index 18d8363ad..9fb0c5d9c 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -34,16 +34,15 @@ code generated by our ``routesalchemy`` paster template does not use declarative SQLAlchemy syntax, so we'll need to change various things to begin to use declarative syntax. -Our ``Page`` class will have a class level attribute ``__tablename__`` -which equals the string ``pages``. This means that SQLAlchemy will -store our wiki data in a SQL table named ``pages``. Our Page class -will also have class-level attributes named ``id``, ``pagename`` and -``data`` (all instances of :class:`sqlalchemy.Column`). These will -map to columns in the ``pages`` table. The ``id`` attribute will be -the primary key in the table. The ``name`` attribute will be a text -attribute, each value of which needs to be unique within the column. -The ``data`` attribute is a text attribute that will hold the body of -each page. +Our ``Page`` class will have a class level attribute ``__tablename__`` which +equals the string ``pages``. This means that SQLAlchemy will store our wiki +data in a SQL table named ``pages``. Our Page class will also have +class-level attributes named ``id``, ``pagename`` and ``data`` (all instances +of :class:`sqlalchemy.Column`). These will map to columns in the ``pages`` +table. The ``id`` attribute will be the primary key in the table. The +``name`` attribute will be a text attribute, each value of which needs to be +unique within the column. The ``data`` attribute is a text attribute that +will hold the body of each page. We'll also remove our ``populate`` function. We'll inline the populate step into ``initialize_sql``, changing our ``initialize_sql`` -- cgit v1.2.3