Jason Chu wrote:
> We ended up writing a test-data.sh script that's really just a python
> script.  It's of this form:
> 
> #!/bin/sh
> tg-admin shell << EOF
> <a bunch of python commands to create objects>
> hub.commit()
> EOF
> 
> Then a simple 'rm old-db.db; tg-admin sql create; ./test-data.sh'
> removes and creates the db with data in it.
> 
> The output of test-data.sh isn't pretty, but it doesn't have to be,
> right?
> 
> Jason



A parallel solution:

#!/usr/bin/env python2.4

import turbogears
turbogears.update_config("dev.cfg")
from myapp.model import *

u1 = TG_User(displayName="foo", emailAddress="[EMAIL PROTECTED]", userId="foo", 
password="foopass")

# .. etc. rinse, repeat
turbogears.hub.commit()

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to