Changeset 5647
- Timestamp:
- 11/01/08 02:14:27 (2 months ago)
- Files:
-
- docs/2.0/docs/main/Wiki20/wiki20.rst (modified) (2 diffs)
- docs/2.0/docs/project_code/wiki_root/trunk/initializeDB.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
docs/2.0/docs/main/Wiki20/wiki20.rst
r5646 r5647 311 311 The easiest way to do this is just to run a Python script. Create a file called 312 312 **initializeDB.py** in the ``Wiki-20`` directory containing the following: 313 314 .. code:: Wiki_root/trunk/wiki20/initializeDB.py 313 314 315 .. code:: wiki_root/trunk/initializeDB.py 315 316 316 317 Now run the program from the ``Wiki-20`` directory: … … 318 319 .. code-block:: bash 319 320 320 $ python initializeDB.py 321 $ python initializeDB.py 322 321 323 322 324 You'll see output, but you should not see error messages. At this point docs/2.0/docs/project_code/wiki_root/trunk/initializeDB.py
r5347 r5647 1 1 from wiki20.model import DBSession, Page, metadata 2 2 from sqlalchemy import create_engine 3 import transaction 3 4 4 5 # Prepare the database connection … … 15 16 # Save the page object to the in memory DBSession 16 17 DBSession.save(page) 18 transaction.commit() 17 19