diff options
| author | Steve Piercy <web@stevepiercy.com> | 2018-06-26 00:30:17 -0700 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2018-06-26 00:30:17 -0700 |
| commit | beeee29617d64f67f8eec2991f6b413351393c9e (patch) | |
| tree | 300288dcc255f3a97ec3ec6266c3ed9a11dd70fd /docs/tutorials/wiki2/definingmodels.rst | |
| parent | 66086301a8d85444bb608e4158c15f25b5ae2cdc (diff) | |
| download | pyramid-beeee29617d64f67f8eec2991f6b413351393c9e.tar.gz pyramid-beeee29617d64f67f8eec2991f6b413351393c9e.tar.bz2 pyramid-beeee29617d64f67f8eec2991f6b413351393c9e.zip | |
rename script to align with cookiecutter default
Diffstat (limited to 'docs/tutorials/wiki2/definingmodels.rst')
| -rw-r--r-- | docs/tutorials/wiki2/definingmodels.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index d76959e30..9ed84ce76 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -158,11 +158,11 @@ the following: Here we align our imports with the names of the models, ``Page`` and ``User``. -Edit ``scripts/initializedb.py`` -================================ +Edit ``scripts/initialize_db.py`` +================================= We haven't looked at the details of this file yet, but within the ``scripts`` -directory of your ``tutorial`` package is a file named ``initializedb.py``. +directory of your ``tutorial`` package is a file named ``initialize_db.py``. Code in this file is executed whenever we run the ``initialize_tutorial_db`` command, as we did in the installation step of this tutorial. @@ -171,15 +171,15 @@ command, as we did in the installation step of this tutorial. The command is named ``initialize_tutorial_db`` because of the mapping defined in the ``[console_scripts]`` entry point of our project's ``setup.py`` file. Since we've changed our model, we need to make changes to our -``initializedb.py`` script. In particular, we'll replace our import of +``initialize_db.py`` script. In particular, we'll replace our import of ``MyModel`` with those of ``User`` and ``Page``. We'll also change the very end of the script to create two ``User`` objects (``basic`` and ``editor``) as well as a ``Page``, rather than a ``MyModel``, and add them to our ``dbsession``. -Open ``tutorial/scripts/initializedb.py`` and edit it to look like the +Open ``tutorial/scripts/initialize_db.py`` and edit it to look like the following: -.. literalinclude:: src/models/tutorial/scripts/initializedb.py +.. literalinclude:: src/models/tutorial/scripts/initialize_db.py :linenos: :language: python :emphasize-lines: 18,44-57 @@ -192,7 +192,7 @@ Installing the project and re-initializing the database Because our model has changed, and in order to reinitialize the database, we need to rerun the ``initialize_tutorial_db`` command to pick up the changes -we've made to both the models.py file and to the initializedb.py file. See +we've made to both the models.py file and to the initialize_db.py file. See :ref:`initialize_db_wiki2` for instructions. Success will look something like this: |
