> Actually, these instructions don't quite work.  At least, they don't
> cause anything to be committed.  Here's what I did to get it working:

Ahh, I should have been more clear, the initializedDB.py file isn't
part of the webap, and should not have needed changes at all the only
place where you need to remove the commits is the controllers
themselves.

initializeDB is mostly just there to show people how easy it is to
reuse your datamodel in command line scripts or outside of turbogears,
so it does nothing fancy at all.

You're right that we should probably use setup_app instead, but the
goal was to show a no-magic script that used the datamodel, so we may
still want to do that somehow.

--Mark Ramm

> 1.  First, use the paster setup-app command to setup the database.
> Using development.ini, the full command would be paster setup-app
> development.ini.  This also has the benefit of running websetup.py,
> and if you have users enabled for this Turbogears 2.0 project, some
> default users and groups will be added into the database.  You may
> also note that websetup.py has a transaction.commit() line--we'll be
> using that later.
> 2.  Modify initializeDB.py as follows:
> -- Comment out or delete the drop_all and create_all lines.  You don't
> need to do that anymore since paster setup-app did all this for you,
> plus more.
> -- Comment out DBSession.commit() (as previously stated)
> -- After DBSession.save(), add the following two lines:
> DBSession.flush()
> transaction.commit()
> 3.  Also, make sure to import transaction at the top of the file
>
> That should cause the FrontPage page entry to be committed to the
> database.
>
> Aaron Levinson
>
> >
>



-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to