diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-12-24 10:55:28 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-12-24 10:55:28 +0000 |
| commit | 5b01ac1141f0d47d6b166c9903cb8b1883ded39e (patch) | |
| tree | 5628381abcb56e04566653754d8d60943cddda0f /docs/tutorials/bfgwiki2/definingmodels.rst | |
| parent | 059618aa9aa28969621fa9885622fb9d15c3d286 (diff) | |
| download | pyramid-5b01ac1141f0d47d6b166c9903cb8b1883ded39e.tar.gz pyramid-5b01ac1141f0d47d6b166c9903cb8b1883ded39e.tar.bz2 pyramid-5b01ac1141f0d47d6b166c9903cb8b1883ded39e.zip | |
Roles and refresh.
Diffstat (limited to 'docs/tutorials/bfgwiki2/definingmodels.rst')
| -rw-r--r-- | docs/tutorials/bfgwiki2/definingmodels.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/tutorials/bfgwiki2/definingmodels.rst b/docs/tutorials/bfgwiki2/definingmodels.rst index 982865a80..0cae00ede 100644 --- a/docs/tutorials/bfgwiki2/definingmodels.rst +++ b/docs/tutorials/bfgwiki2/definingmodels.rst @@ -24,19 +24,19 @@ sample and we're not going to use it. Then, we'll add a ``Page`` class. Because this is a SQLAlchemy application, this class should inherit from an instance of -``sqlalchemy.ext.declarative.declarative_base``. Declarative +:class:`sqlalchemy.ext.declarative.declarative_base`. Declarative SQLAlchemy models are easier to use than directly-mapped ones. The 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. +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 ``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 +``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. |
