diff options
| author | Michael Merickel <michael@merickel.org> | 2015-10-21 16:57:52 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2015-10-21 16:57:52 -0500 |
| commit | adb9377a963d7fdc7b7bf616740fb5dd2e40b2bf (patch) | |
| tree | 1038d03a21148607c79f740f0b32b147929251bf /docs/tutorials/wiki/definingmodels.rst | |
| parent | 452fdbef94bb29560497ec8a9ccbc3b9c2ecd2dd (diff) | |
| parent | d4221720b8409eafb65b301562be327af0196c7e (diff) | |
| download | pyramid-adb9377a963d7fdc7b7bf616740fb5dd2e40b2bf.tar.gz pyramid-adb9377a963d7fdc7b7bf616740fb5dd2e40b2bf.tar.bz2 pyramid-adb9377a963d7fdc7b7bf616740fb5dd2e40b2bf.zip | |
Merge branch 'master' into feature/alchemy-scaffold-update
Diffstat (limited to 'docs/tutorials/wiki/definingmodels.rst')
| -rw-r--r-- | docs/tutorials/wiki/definingmodels.rst | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 49372179f..859e902ab 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -15,7 +15,7 @@ single instance of the "Wiki" class will serve as a container for "Page" objects, which will be instances of the "Page" class. -Delete the Database +Delete the database ------------------- In the next step, we're going to remove the ``MyModel`` Python model @@ -32,12 +32,19 @@ Edit ``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, + files. Files implementing models often have ``model`` in their filenames or they may live in a Python subpackage of your application package named ``models``, but this is only by convention. +Open ``tutorial/tutorial/models.py`` file and edit it to look like the +following: + +.. literalinclude:: src/models/tutorial/models.py + :linenos: + :language: python + The first thing we want to do is remove the ``MyModel`` class from the generated ``models.py`` file. The ``MyModel`` class is only a sample and we're not going to use it. @@ -70,17 +77,7 @@ front page) into the Wiki within the ``appmaker``. This will provide :term:`traversal` a :term:`resource tree` to work against when it attempts to resolve URLs to resources. -Look at the Result of Our Edits to ``models.py`` ------------------------------------------------- - -The result of all of our edits to ``models.py`` will end up looking -something like this: - -.. literalinclude:: src/models/tutorial/models.py - :linenos: - :language: python - -View the Application in a Browser +View the application in a browser --------------------------------- We can't. At this point, our system is in a "non-runnable" state; we'll need |
