On 2/9/07, Henrik Lied <[EMAIL PROTECTED]> wrote: > > Hi there! > > I was wondering if there's an easy way to insert a lot of dummy > content into a couple of models. Have anyone written something that > does this?
Yes - it's not quite in Django yet, but it will be soon (before v1.0). Its the fixtures framework. A patch containing the code is attached to ticket #2333; You may also need to apply the patches from tickets #3390 and #2720 depending on the complexity of your data model and your database backend. The original intent was to allow developers to write unit tests, and have data in the database during that test; however, it can also be used to put a whole lot of initial data into the database. It's not documented yet, but the modeltest that is part of ticket #2333 should give you an example of how to use the fixtures framework programatically. From the command line, its as simple as: - creating a fixtures directory in your application directory - putting mydata.json in the fixtures directory - filling mydata.json with intialization data - running ./manage.py loaddata mydata Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---