diff options
| author | Chris Shenton <chris@koansys.com> | 2012-03-13 16:01:18 -0700 |
|---|---|---|
| committer | Chris Shenton <chris@koansys.com> | 2012-03-13 16:01:18 -0700 |
| commit | 3484f0c0fdbfc05ff9a289255c294379348beba5 (patch) | |
| tree | 6b107a7ad71c7d39832a70a78b6c0b24dbd67786 /docs/tutorials/wiki2/definingmodels.rst | |
| parent | 1e5ba8a07c583073f1d885156c92a266ceb8dce9 (diff) | |
| parent | 3ea3ec0de35db406ab2dd4d19f396ae5dbce88b1 (diff) | |
| download | pyramid-3484f0c0fdbfc05ff9a289255c294379348beba5.tar.gz pyramid-3484f0c0fdbfc05ff9a289255c294379348beba5.tar.bz2 pyramid-3484f0c0fdbfc05ff9a289255c294379348beba5.zip | |
Merge remote-tracking branch 'upstream/master' into shentonfreude/bug.sqltut-test-populate-settings
Diffstat (limited to 'docs/tutorials/wiki2/definingmodels.rst')
| -rw-r--r-- | docs/tutorials/wiki2/definingmodels.rst | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index 2b8932a98..0810ad1c5 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -21,11 +21,15 @@ Making Edits to ``models.py`` (or they may live in a Python subpackage of your application package named ``models``) , but this is only by convention. -Here's what our ``models.py`` file should look like after this step: +Open ``tutorial/tutorial/models.py`` file and edit it to look like the +following: .. literalinclude:: src/models/tutorial/models.py :linenos: :language: py + :emphasize-lines: 19-21,24,26,28 + +(The highlighted lines are the ones that need to be changed.) The first thing we've done is to do is remove the stock ``MyModel`` class from the generated ``models.py`` file. The ``MyModel`` class is only a @@ -63,12 +67,15 @@ script. In particular, we'll replace our import of ``MyModel`` with one of ``Page`` and we'll change the very end of the script to create a ``Page`` rather than a ``MyModel`` and add it to our ``DBSession``. -The result of all of our edits to ``populate.py`` will end up looking -something like this: +Open ``tutorial/tutorial/scripts/populate.py`` and edit it to look like the +following: .. literalinclude:: src/models/tutorial/scripts/populate.py :linenos: :language: python + :emphasize-lines: 14,34 + +(Only the highlighted lines need to be changed.) Repopulating the Database ------------------------- @@ -122,7 +129,8 @@ Viewing the Application in a Browser We can't. At this point, our system is in a "non-runnable" state; we'll need to change view-related files in the next chapter to be able to start the -application successfully. If you try to start the application, you'll wind +application successfully. If you try to start the application (See +:ref:`wiki2-start-the-application`), you'll wind up with a Python traceback on your console that ends with this exception: .. code-block:: text |
