Skip to content
This repository
Browse code

Renamed db populate to initialize in SQL tutorial

- Replaced populate_tutorial -> initialize_tutorial_db
- Renamed populate.py -> initializedb.py
- Updated references in the documenation
  • Loading branch information...
commit c884eea0abeac00fdff6821329c2981caa5c8db4 1 parent 58df8cb
authored March 14, 2012
28  docs/tutorials/wiki2/definingmodels.rst
Source Rendered
@@ -54,48 +54,48 @@ in the table.  The ``name`` attribute will be a text attribute, each value of
54 54
 which needs to be unique within the column.  The ``data`` attribute is a text
55 55
 attribute that will hold the body of each page.
56 56
 
57  
-Changing ``scripts/populate.py``
58  
---------------------------------
  57
+Changing ``scripts/initializedb.py``
  58
+------------------------------------
59 59
 
60 60
 We haven't looked at the guts of this file yet, but within the ``scripts``
61  
-directory of your ``tutorial`` package is a file named ``populate.py``.  Code
62  
-in this file is executed whenever we run the ``populate_tutorial`` command
  61
+directory of your ``tutorial`` package is a file named ``initializedb.py``.  Code
  62
+in this file is executed whenever we run the ``initialize_tutorial_db`` command
63 63
 (as we did in the installation step of this tutorial).
64 64
 
65  
-Since we've changed our model, we need to make changes to our ``populate.py``
  65
+Since we've changed our model, we need to make changes to our ``initializedb.py``
66 66
 script.  In particular, we'll replace our import of ``MyModel`` with one of
67 67
 ``Page`` and we'll change the very end of the script to create a ``Page``
68 68
 rather than a ``MyModel`` and add it to our ``DBSession``.
69 69
 
70  
-Open ``tutorial/tutorial/scripts/populate.py`` and edit it to look like the 
  70
+Open ``tutorial/tutorial/scripts/initializedb.py`` and edit it to look like the 
71 71
 following:
72 72
 
73  
-.. literalinclude:: src/models/tutorial/scripts/populate.py
  73
+.. literalinclude:: src/models/tutorial/scripts/initializedb.py
74 74
    :linenos:
75 75
    :language: python
76 76
    :emphasize-lines: 14,34
77 77
 
78 78
 (Only the highlighted lines need to be changed.)
79 79
 
80  
-Repopulating the Database
81  
--------------------------
  80
+Reinitializing the Database
  81
+---------------------------
82 82
 
83  
-Because our model has changed, in order to repopulate the database, we need
84  
-to rerun the ``populate_tutorial`` command to pick up the changes you've made
85  
-to both the models.py file and to the populate.py file.  From the root of the
  83
+Because our model has changed, in order to reinitialize the database, we need
  84
+to rerun the ``initialize_tutorial_db`` command to pick up the changes you've made
  85
+to both the models.py file and to the initializedb.py file.  From the root of the
86 86
 ``tutorial`` project, directory execute the following commands.
87 87
 
88 88
 On UNIX:
89 89
 
90 90
 .. code-block:: text
91 91
 
92  
-   $ ../bin/populate_tutorial development.ini
  92
+   $ ../bin/initialize_tutorial_db development.ini
93 93
 
94 94
 On Windows:
95 95
 
96 96
 .. code-block:: text
97 97
 
98  
-   c:\pyramidtut\tutorial> ..\Scripts\populate_tutorial development.ini
  98
+   c:\pyramidtut\tutorial> ..\Scripts\initialize_tutorial_db development.ini
99 99
 
100 100
 Success will look something like this::
101 101
 
18  docs/tutorials/wiki2/installation.rst
Source Rendered
@@ -96,9 +96,9 @@ On Windows:
96 96
 Success executing this command will end with a line to the console something
97 97
 like::
98 98
 
99  
-   Please run the "populate_tutorial" script to set up the SQL 
  99
+   Please run the "initialize_tutorial_db" script to set up the SQL 
100 100
    database before starting the application (e.g. 
101  
-   "$myvirtualenv/bin/populate_tutorial development.ini".)
  101
+   "$myvirtualenv/bin/initialize_tutorial_db development.ini".)
102 102
 
103 103
 Installing the Project in "Development Mode"
104 104
 ============================================
@@ -242,8 +242,8 @@ If successful, you will see something like this on your console::
242 242
 
243 243
 This means the server is ready to accept requests.
244 244
 
245  
-Populating the Database
246  
-=======================
  245
+Initializing the Database
  246
+=========================
247 247
 
248 248
 In a web browser, visit ``http://localhost:6543/``. 
249 249
 
@@ -255,9 +255,9 @@ You will see an error page with a title something like this::
255 255
 
256 256
 Oh no!  Something isn't working!
257 257
 
258  
-This happens because we haven't populated the SQL database with any table
259  
-information yet.  We need to use the ``populate_tutorial`` :term:`console
260  
-script` to populate our database before we can see the page render correctly.
  258
+This happens because we haven't initialized the SQL database with any table
  259
+information yet.  We need to use the ``initialize_tutorial_db`` :term:`console
  260
+script` to initialize our database before we can see the page render correctly.
261 261
 
262 262
 Stop the running Pyramid application by pressing ``ctrl-C`` in the console.
263 263
 Make sure you're still in the ``tutorial`` directory (the directory with a
@@ -267,13 +267,13 @@ On UNIX:
267 267
 
268 268
 .. code-block:: text
269 269
 
270  
-   $ ../bin/populate_tutorial development.ini
  270
+   $ ../bin/initialize_tutorial_db development.ini
271 271
 
272 272
 On Windows:
273 273
 
274 274
 .. code-block:: text
275 275
 
276  
-   c:\pyramidtut\tutorial> ..\Scripts\populate_tutorial development.ini
  276
+   c:\pyramidtut\tutorial> ..\Scripts\initialize_tutorial_db development.ini
277 277
 
278 278
 The output to your console should be something like this::
279 279
 
2  docs/tutorials/wiki2/src/authorization/setup.py
@@ -40,6 +40,6 @@
40 40
       [paste.app_factory]
41 41
       main = tutorial:main
42 42
       [console_scripts]
43  
-      populate_tutorial = tutorial.scripts.populate:main
  43
+      initialize_tutorial_db = tutorial.scripts.initializedb:main
44 44
       """,
45 45
       )
0  ...i2/src/authorization/tutorial/scripts/populate.py → ...rc/authorization/tutorial/scripts/initializedb.py
File renamed without changes
2  docs/tutorials/wiki2/src/basiclayout/setup.py
@@ -39,7 +39,7 @@
39 39
       [paste.app_factory]
40 40
       main = tutorial:main
41 41
       [console_scripts]
42  
-      populate_tutorial = tutorial.scripts.populate:main
  42
+      initialize_tutorial_db = tutorial.scripts.initializedb:main
43 43
       """,
44 44
       )
45 45
 
0  ...iki2/src/basiclayout/tutorial/scripts/populate.py → .../src/basiclayout/tutorial/scripts/initializedb.py
File renamed without changes
2  docs/tutorials/wiki2/src/models/setup.py
@@ -39,7 +39,7 @@
39 39
       [paste.app_factory]
40 40
       main = tutorial:main
41 41
       [console_scripts]
42  
-      populate_tutorial = tutorial.scripts.populate:main
  42
+      initialize_tutorial_db = tutorial.scripts.initializedb:main
43 43
       """,
44 44
       )
45 45
 
0  ...als/wiki2/src/models/tutorial/scripts/populate.py → ...wiki2/src/models/tutorial/scripts/initializedb.py
File renamed without changes
2  docs/tutorials/wiki2/src/tests/setup.py
@@ -41,6 +41,6 @@
41 41
       [paste.app_factory]
42 42
       main = tutorial:main
43 43
       [console_scripts]
44  
-      populate_tutorial = tutorial.scripts.populate:main
  44
+      initialize_tutorial_db = tutorial.scripts.initializedb:main
45 45
       """,
46 46
       )
0  ...ials/wiki2/src/tests/tutorial/scripts/populate.py → .../wiki2/src/tests/tutorial/scripts/initializedb.py
File renamed without changes
2  docs/tutorials/wiki2/src/views/setup.py
@@ -40,7 +40,7 @@
40 40
       [paste.app_factory]
41 41
       main = tutorial:main
42 42
       [console_scripts]
43  
-      populate_tutorial = tutorial.scripts.populate:main
  43
+      initialize_tutorial_db = tutorial.scripts.initializedb:main
44 44
       """,
45 45
       )
46 46
 
0  ...ials/wiki2/src/views/tutorial/scripts/populate.py → .../wiki2/src/views/tutorial/scripts/initializedb.py
File renamed without changes
5  docs/tutorials/wiki2/tests.rst
Source Rendered
@@ -13,9 +13,8 @@ We write a test class for the model class ``Page`` and another test class
13 13
 for the ``initialize_sql`` function.
14 14
 
15 15
 To do so, we'll retain the ``tutorial.tests.ViewTests`` class provided as a
16  
-result of the ``alchemy`` scaffold.  We'll add two test classes: one for the
17  
-``Page`` model named ``PageModelTests``, and one for the ``populate`` script
18  
-named ``Test_populate``.
  16
+result of the ``alchemy`` scaffold.  We'll add a test class named
  17
+``PageModelTests`` for the ``Page`` model.
19 18
 
20 19
 Testing the Views
21 20
 =================

0 notes on commit c884eea

Please sign in to comment.
Something went wrong with that request. Please try again.