Re: automatic initialization of sample data

2009-09-09 Thread Jan Ostrochovsky
Bill, thanks for answer, my comments are inline: On Sep 8, 4:29 pm, Bill Freeman wrote: > Well, do you want this to happen every time that the module is imported?  Or > spend time > each server start determining that these items are already in the data base > and skipping > the initialization?

Re: automatic initialization of sample data

2009-09-08 Thread Bill Freeman
Jan, Well, do you want this to happen every time that the module is imported? Or spend time each server start determining that these items are already in the data base and skipping the initialization? If not, then you're stuck telling the system when to do this anyway (perhaps a syncdb extension

Re: automatic initialization of sample data

2009-09-07 Thread Jan Ostrochovsky
Thanks Bill, yes, that is one possible solution, when implementing such feature from the scratch. I am only asking, if there is some existing framework for such need, which I see as common. For example some add-on to Django, which will do this for me. Let's imagine additional option for any fiel

Re: automatic initialization of sample data

2009-08-20 Thread Bill Freeman
Perhaps I'm not understanding correctly, but how about, assuming you have a function run_data_inits() that calls your chain of init_sample_data() functions: $ python manage.py shell >>> import myproject.myapp.models as m >>> m.run_data_inits() >>> ^D Bill On Thu, Aug 20, 2009 at 9:25 AM, Jan Os

automatic initialization of sample data

2009-08-20 Thread Jan Ostrochovsky
Hello, we are in the initial phase of software project, and data model and names of attributes are changing very often, and very often we need to create new database and fill it with the same sample data for testing. We want to automate this creation of sample data. Our idea: add into each model