From b2533554bb8816d412615595f4d7947f7779bf47 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 14 Aug 2011 22:44:22 -0400 Subject: - The ZODB wiki tutorial now uses the ``pyramid_zodbconn`` package rather than the ``repoze.zodbconn`` package to provide ZODB integration. - The ZODB scaffold now uses the ``pyramid_zodbconn`` package rather than the ``repoze.zodbconn`` package to provide ZODB integration. --- docs/tutorials/wiki/definingmodels.rst | 6 ------ 1 file changed, 6 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index baf497458..9dd53609e 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -73,12 +73,6 @@ 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. -We're using a mini-framework callable named ``PersistentApplicationFinder`` -in our application (see ``__init__.py``). A ``PersistentApplicationFinder`` -accepts a ZODB URL as well as an "appmaker" callback. This callback -typically lives in the ``models.py`` file. We'll just change this function, -making the necessary edits. - Looking at the Result of Our Edits to ``models.py`` --------------------------------------------------- -- cgit v1.2.3 From cfb2b5596b8ef366aeef3bce5b61eafc7a2f175d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 6 Oct 2011 03:05:29 -0400 Subject: remove all reference to the paster command-line utility --- docs/tutorials/wiki/definingmodels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 9dd53609e..ee9c13ab2 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -2,7 +2,7 @@ Defining the Domain Model ========================= -The first change we'll make to our stock paster-generated application will be +The first change we'll make to our stock pcreate-generated application will be to define two :term:`resource` constructors, one representing a wiki page, and another representing the wiki as a mapping of wiki page names to page objects. We'll do this inside our ``models.py`` file. -- cgit v1.2.3 From 9b215d25112e7f466512ebbcfb2007abe070c9f7 Mon Sep 17 00:00:00 2001 From: kenmanheimer Date: Tue, 8 Nov 2011 16:34:20 -0800 Subject: Use active ("Run the Tests") rather than passive ("Running the Tests") voice for the headings. --- docs/tutorials/wiki/definingmodels.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index ee9c13ab2..cdf3b6092 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -18,8 +18,8 @@ The source code for this tutorial stage can be browsed via `http://github.com/Pylons/pyramid/tree/master/docs/tutorials/wiki/src/models/ `_. -Deleting the Database ---------------------- +Delete the Database +------------------- In the next step, we're going to remove the ``MyModel`` Python model class from our ``models.py`` file. Since this class is referred to within @@ -30,8 +30,8 @@ directory before proceeding any further. It's always fine to do this as long as you don't care about the content of the database; the database itself will be recreated as necessary. -Making Edits to ``models.py`` ------------------------------ +Edit ``models.py`` +------------------ .. note:: @@ -73,8 +73,8 @@ 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. -Looking at the Result of Our Edits to ``models.py`` ---------------------------------------------------- +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: @@ -83,8 +83,8 @@ something like this: :linenos: :language: python -Viewing 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 to change view-related files in the next chapter to be able to start the -- cgit v1.2.3 From 218ad474c5e8db6925ed6a5f4067ae3db69f68c8 Mon Sep 17 00:00:00 2001 From: Patricio Paez Date: Mon, 12 Mar 2012 15:49:58 -0700 Subject: Added links to Starting the Application - Sections 'Viewing the Application in a Browser' in the 'Defining the Domain Model' and 'Defining the Views' chapters now offer a quick link in both wiki tutorials, as suggested by Paulo. --- docs/tutorials/wiki/definingmodels.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index cdf3b6092..982d6ea74 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -88,7 +88,8 @@ View 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:`wiki-start-the-application`), you'll wind up with a Python traceback on your console that ends with this exception: .. code-block:: text -- cgit v1.2.3 From 692fd6816616ed5b3cb9ef3c0f2c6eff2276da93 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 17 Mar 2012 00:05:06 -0400 Subject: master->1.3-branch --- docs/tutorials/wiki/definingmodels.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 982d6ea74..1a5d38b10 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -15,8 +15,8 @@ single instance of the "Wiki" class will serve as a container for "Page" objects, which will be instances of the "Page" class. The source code for this tutorial stage can be browsed via -`http://github.com/Pylons/pyramid/tree/master/docs/tutorials/wiki/src/models/ -`_. +`http://github.com/Pylons/pyramid/tree/1.3-branch/docs/tutorials/wiki/src/models/ +`_. Delete the Database ------------------- -- cgit v1.2.3 From 043ccddb909327106264d10ed5d413760a51770d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 2 Jan 2013 02:22:52 +0200 Subject: eliminate other repeated words --- docs/tutorials/wiki/definingmodels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 1a5d38b10..2cbe691fa 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -63,7 +63,7 @@ contain the :term:`ReStructuredText` body representing the wiki page content. Note that ``Page`` objects don't have an initial ``__name__`` or ``__parent__`` attribute. All objects in a traversal graph must have a ``__name__`` and a ``__parent__`` attribute. We don't specify these here -because both ``__name__`` and ``__parent__`` will be set by by a :term:`view` +because both ``__name__`` and ``__parent__`` will be set by a :term:`view` function when a Page is added to our Wiki mapping. As a last step, we want to change the ``appmaker`` function in our -- cgit v1.2.3 From 445eb8708fa48209947377f6de609799dd843ad6 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 20 Jan 2013 17:10:40 +0200 Subject: point to the sources of the wiki tutorials in just one location; fix #763 * This avoids having to update the link multiple times. * Also, mention their location, in case user has Pyramid checkout. --- docs/tutorials/wiki/definingmodels.rst | 3 --- 1 file changed, 3 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 2cbe691fa..1d2710975 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -14,9 +14,6 @@ constructors". Both our Page and Wiki constructors will be class objects. A single instance of the "Wiki" class will serve as a container for "Page" objects, which will be instances of the "Page" class. -The source code for this tutorial stage can be browsed via -`http://github.com/Pylons/pyramid/tree/1.3-branch/docs/tutorials/wiki/src/models/ -`_. Delete the Database ------------------- -- cgit v1.2.3 From f1134866e8ca96e1309dca930bd5345233748659 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 22 Jan 2013 00:16:17 -0800 Subject: More grammar clean up. --- docs/tutorials/wiki/definingmodels.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 1d2710975..49372179f 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -33,7 +33,7 @@ Edit ``models.py`` .. note:: There is nothing automagically special about the filename ``models.py``. A - project may have many models throughout its codebase in arbitrarily-named + project may have many models throughout its codebase in arbitrarily named 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. @@ -56,7 +56,7 @@ of the root model is also always ``None``. Then we'll add a ``Page`` class. This class should inherit from the :class:`persistent.Persistent` class. We'll also give it an ``__init__`` method that accepts a single parameter named ``data``. This parameter will -contain the :term:`ReStructuredText` body representing the wiki page content. +contain the :term:`reStructuredText` body representing the wiki page content. Note that ``Page`` objects don't have an initial ``__name__`` or ``__parent__`` attribute. All objects in a traversal graph must have a ``__name__`` and a ``__parent__`` attribute. We don't specify these here -- cgit v1.2.3 From dd6232d43ca974e95742275312a06863c2bd0744 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 25 May 2015 15:52:53 -0700 Subject: wikis consistency, grammar, wrapping --- docs/tutorials/wiki/definingmodels.rst | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') 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 -- cgit v1.2.3 From 93a7a14d0abf0a7c1659275dc78ebc15247ca893 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Apr 2016 15:17:52 -0700 Subject: - fix traversal tutorial reference - add intersphinx targets to wiki/* --- docs/tutorials/wiki/definingmodels.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 859e902ab..954a317f8 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -1,3 +1,5 @@ +.. _wiki_defining_the_domain_model: + ========================= Defining the Domain Model ========================= -- cgit v1.2.3 From 2703e73c6d037ce0bf727e990feae095bb5bec4b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Apr 2016 20:35:00 -0700 Subject: update basiclayout and its src --- docs/tutorials/wiki/definingmodels.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'docs/tutorials/wiki/definingmodels.rst') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 954a317f8..73dce14d5 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -4,8 +4,8 @@ Defining the Domain Model ========================= -The first change we'll make to our stock pcreate-generated application will be -to define two :term:`resource` constructors, one representing a wiki page, +The first change we'll make to our stock ``pcreate``-generated application will +be to define two :term:`resource` constructors, one representing a wiki page, and another representing the wiki as a mapping of wiki page names to page objects. We'll do this inside our ``models.py`` file. @@ -40,8 +40,7 @@ Edit ``models.py`` 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: +Open ``tutorial/models.py`` file and edit it to look like the following: .. literalinclude:: src/models/tutorial/models.py :linenos: -- cgit v1.2.3