diff options
| author | Marc Abramowitz <marca@surveymonkey.com> | 2012-11-30 09:27:09 -0800 |
|---|---|---|
| committer | Marc Abramowitz <marca@surveymonkey.com> | 2012-11-30 09:38:54 -0800 |
| commit | b9b2ee39c251dd68a12e717e1f6d9d02a29efe9a (patch) | |
| tree | a93ba55122748375c84e563015b4a122eea3fcb9 /docs/tutorials/wiki2/definingmodels.rst | |
| parent | 0f2bbe521970aac9bf41f5ab9069256dac9f9cc5 (diff) | |
| download | pyramid-b9b2ee39c251dd68a12e717e1f6d9d02a29efe9a.tar.gz pyramid-b9b2ee39c251dd68a12e717e1f6d9d02a29efe9a.tar.bz2 pyramid-b9b2ee39c251dd68a12e717e1f6d9d02a29efe9a.zip | |
A bunch of minor tweaks to the wiki2 tutorial in docs/tutorials/wiki2
Diffstat (limited to 'docs/tutorials/wiki2/definingmodels.rst')
| -rw-r--r-- | docs/tutorials/wiki2/definingmodels.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index 1653faf4a..2e6c74c99 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -2,7 +2,7 @@ Defining the Domain Model ========================= -The first change we'll make to our stock pcreate-generated application will +The first change we'll make to our stock ``pcreate``-generated application will be to define a :term:`domain model` constructor representing a wiki page. We'll do this inside our ``models.py`` file. @@ -15,7 +15,7 @@ Making Edits to ``models.py`` .. note:: - There is nothing automagically special about the filename ``models.py``. A + There is nothing special about the filename ``models.py``. A project may have many models throughout its codebase in arbitrarily-named files. Files implementing models often have ``model`` in their filenames (or they may live in a Python subpackage of your application package named @@ -46,8 +46,8 @@ this class inherits from an instance of As you can see, our ``Page`` class has 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``, ``name`` and +SQLAlchemy will store our wiki data in a SQL table named ``pages``. Our +``Page`` class will also have class-level attributes named ``id``, ``name`` 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 |
