Phlip There are a number of posts discussing this issue - one of them may give you some pointers:
http://stackoverflow.com/questions/1136106/efficent-way-to-insert-thousands-of-records-into-a-table-sqlite-python-django http://stackoverflow.com/questions/2655670/how-do-i-perform-a-batch-insert-in-django http://djangosnippets.org/snippets/446/ (for MySQL) On Feb 2, 12:52 am, Phlip <phlip2...@gmail.com> wrote: > Bump? String together the SQL myself? > > On Jan 31, 3:40 pm, Phlip <phlip2...@gmail.com> wrote: > > > > > > > > > Djangoists: > > > Given a model Tree with many Leaves, I want to write this: > > > t = Tree(data=42) > > t.leaves.add(leafy_data=43) > > t.leaves.add(leafy_data=44) > > t.save() > > > I want the save() to create the Tree, then create the leaves. Other > > notations would do fine. > > > Batching like this might permit the ORM to optimize the database > > calls. If not, that's okay to. > > > Google doesn't say Django can do this. > > > My specific problem is I have a dozen trees with a couple thousand > > leaves each, and simply writing them all causes a bottleneck. > > > -- > > Phlip > > http://c2.com/cgi/wiki?ZeekLand -- 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.