diff options
| author | Chris McDonough <chrism@plope.com> | 2012-12-10 15:34:30 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-12-10 15:34:30 -0500 |
| commit | 8389a5b3339b18f2ba7242d05d11ecb64371f3d9 (patch) | |
| tree | 113a6b7aea8015518c89cfa42e9bb0df34bed37c /docs/tutorials/wiki2/definingmodels.rst | |
| parent | a078e197d04400d2430206fe31e3398c761b20a3 (diff) | |
| parent | f3a84be3b0e37b74acc26cfb413800610af85b86 (diff) | |
| download | pyramid-8389a5b3339b18f2ba7242d05d11ecb64371f3d9.tar.gz pyramid-8389a5b3339b18f2ba7242d05d11ecb64371f3d9.tar.bz2 pyramid-8389a5b3339b18f2ba7242d05d11ecb64371f3d9.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/tutorials/wiki2/definingmodels.rst')
| -rw-r--r-- | docs/tutorials/wiki2/definingmodels.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index 1653faf4a..2148582f1 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 @@ -27,7 +27,7 @@ following: .. literalinclude:: src/models/tutorial/models.py :linenos: :language: py - :emphasize-lines: 19-21,24,26,28 + :emphasize-lines: 20-22,25,27,29 (The highlighted lines are the ones that need to be changed.) @@ -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 @@ -73,7 +73,7 @@ following: .. literalinclude:: src/models/tutorial/scripts/initializedb.py :linenos: :language: python - :emphasize-lines: 14,34 + :emphasize-lines: 14,36 (Only the highlighted lines need to be changed.) |
