On 10/11/06, Matthew Bevan <[EMAIL PROTECTED]> wrote:
> The following is a snippit of code that I use to pre-populate a database
> with sample values: (note that it isn't simply redirecting a file to
> tg-admin shell.)
I'm sorry to say this but it is.
if you look at the shell code. it loads your tg project and it loads
your config.
http://trac.turbogears.org/turbogears/browser/tags/1.0b1/turbogears/command/base.py#L173

although your code provides an external config file which will be a
nice addition. patches accepted :D

on the other hand I do agree with you that we should provide a similar
functionality to prepopulate data say a dump of the db. so you can
dump all the content of a db and load it up on another one but this is
already provided at the db layer so it's not a priority.

the thing is that a prepopulated model will be
a) a small languaje saying to object A add entries b,c,d, etc.
b) a bunch of SO "inserts" which is well using an input file and we
are back to where we starter.

you may get an example of this at
http://diplomacy.python-hosting.com/file/trunk/data.sql.py

but don't look at the rest I haven't had time to work on that

> # encoding: utf-8
> package_name = 'bobsyouruncle'
>
you may also want to replace that line with.
the tools in turbogears.util

like get_package_name() and get_model()

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