diff options
| author | Michael Merickel <michael@merickel.org> | 2015-10-21 00:34:10 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2015-10-21 00:34:10 -0500 |
| commit | 504027873ab0e1b15601e2d1900ef8a4469f6a43 (patch) | |
| tree | 06e6cbf634a894dbce232c9dbb06324637a95a86 /docs/tutorials/wiki/definingmodels.rst | |
| parent | bf40a3920278b3e7a01ef5403196b35f45cfcb3c (diff) | |
| parent | e1ec631ab2d470b1550640d21c28ddd1387f4045 (diff) | |
| download | pyramid-504027873ab0e1b15601e2d1900ef8a4469f6a43.tar.gz pyramid-504027873ab0e1b15601e2d1900ef8a4469f6a43.tar.bz2 pyramid-504027873ab0e1b15601e2d1900ef8a4469f6a43.zip | |
Merge pull request #2020 from bertjwregeer/feature/configurable-view-deriver
Configurable View Deriver moving forward...
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 |
