diff options
| author | Chris McDonough <chrism@plope.com> | 2013-04-03 17:37:21 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2013-04-03 17:37:21 -0400 |
| commit | d64fa6136d0dec6717b273362de548d8f3bf47e8 (patch) | |
| tree | 23c77ac62ab9d6c93131874f835ae3166d4af53b /docs/tutorials/wiki2/definingmodels.rst | |
| parent | 2ca9bde9d2862655ddee276cd14a375e6a5adec6 (diff) | |
| parent | 84e455cf7c8d9cbfe6658548a61af2ecbbc1749e (diff) | |
| download | pyramid-d64fa6136d0dec6717b273362de548d8f3bf47e8.tar.gz pyramid-d64fa6136d0dec6717b273362de548d8f3bf47e8.tar.bz2 pyramid-d64fa6136d0dec6717b273362de548d8f3bf47e8.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 | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index bd1cb00d7..60427a911 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -34,7 +34,7 @@ sample and we're not going to use it. Then, we added a ``Page`` class. Because this is a SQLAlchemy application, this class inherits from an instance of -:class:`sqlalchemy.ext.declarative.declarative_base`. +:func:`sqlalchemy.ext.declarative.declarative_base`. .. literalinclude:: src/models/tutorial/models.py :pyobject: Page @@ -45,9 +45,10 @@ 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 -``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 +``data`` (all instances of :class:`sqlalchemy.schema.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. @@ -77,8 +78,6 @@ following: Installing the Project and re-initializing the Database ------------------------------------------------------- -Redo the steps in :ref:`installing_project_in_dev_mode`. - Because our model has changed, in order to reinitialize the database, we need to rerun the ``initialize_tutorial_db`` command to pick up the changes you've made to both the models.py file and to the initializedb.py file. |
