> The initial data fixture is reloaded every time that syncdb is > executed; this will overwrite any changes that have been made to that > initial data. This is normal, intended behaviour, and there isn't a > setting or option to change this behaviour. >
I had a feeling that was the case... Having an option to add data in the way you describe isn't really a > good idea. If the syncdb behaviour was changed to add rather than > overwrite initial data, you would have a different (and IMHO much > worse) consequence - each time you run syncdb, you will end up with > another copy of the initial data. If you run syncdb 100 times, you > would end up with 100 copies of each fixture object. > What I was envisioning was a solution that would check if the PK existed, if it did, it would pass, if not, it would add the rows. The intended use was to populate a database at first go with the needed data, but still be able to run syncdb without mucking things up. Guess I'll have to go the other route. The purpose behind the initial data fixture is to provide *absolutely > essential* initial data that must exist in order for the database to > work - for example, the root node of a tree structure. If you have > other data that is required to bootstrap the system - especially if > that data is subject to change over the lifespan of the website - > define that data in a fixture other that initial_data (say > bootstrap_data), and manually load that fixture using loaddata. That > way the bootstrap data will only be loaded (and therefore overwritten) > when you explictly request a reload. > Thanks, that is good advice, I will go ahead and do that. That will accomplish just about what I am looking for. Would it suffice to just rename the file/folder to bootstrap_data/bootstrap_data.json? Does Django look for a file called initial_data.json in a folder called initial_data, or does it just look for any file called initial_data.json? Thanks a lot Russ. Cheers, D --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---