Thanks, Dennis. Some of the fixtures are order dependent. I will have to do some more research on how to use glob.glob() and spawn. For now, just adding the list of python loaddata commands to a shell script seem to work great. Thanks again for the info! L J
On Feb 18, 4:33 pm, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: > On Sat, 18 Feb 2012 08:46:25 -0800 (PST), LJ <ljayad...@gmail.com> > wrote: > > >I would like to create a script to call all of these, so I can insert > >them all at once. > >I do not want to combine all of the json files. > > Are they order dependent? That is, do any of the loads require > certain data to have already been loaded? Foreign key constraints, > perhaps? > > If so, you may want to just create a shell script of the commands > rather than running a Python process which just spawns separate > processes to do the load call. > > If they are NOT order dependent (OR you are willing to rename them > into some scheme that can be sorted) AND if all the .json files in the > directory are to be loaded (they are not used for any other use), THEN > you might consider a Python script that reads the directory contents > (glob.glob() ?) into a list of all the .json files and spawns the load > command for each (possibly after sorting per the ordering scheme). Of > course, you could probably develop a shell script to do the same thing. > The Python version would be more portable if you change OS. > > >>> import glob > >>> for fid in glob.glob("*"): > > ... print "pretend to spawn using %s" % fid > ... > pretend to spawn using license.txt > pretend to spawn using mfc90.dll > pretend to spawn using mfc90u.dll > pretend to spawn using mfcm90.dll > pretend to spawn using mfcm90u.dll > pretend to spawn using Microsoft.VC90.MFC.manifest > pretend to spawn using Pythonwin.exe > pretend to spawn using pywin > pretend to spawn using scintilla.dll > pretend to spawn using win32ui.pyd > pretend to spawn using win32uiole.pyd > > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfr...@ix.netcom.com HTTP://wlfraed.home.netcom.com/ -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.