-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Abiel declared:
> Is there an efficient way to use Django models to load a large number
> of records into a database without falling back on raw SQL? Creating a
> large number of model objects and then saving each one individually is
> very slow (I imagine Django is running INSERT and COMMIT each time?).
> 
> Thanks very much.

You can use python manage.py loaddata with a JSON file (and a few other
encodings as well).  Also, check out python manage.py dumpdata for the
reverse operation.  I've also managed to code up a CSV import system for
my project...

- --
Randy Barlow
Software Developer
The American Research Institute
http://americanri.com
919.228.4971
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqNnP0ACgkQw3vjPfF7QfVoOACgkgUSeUWVn56T0CCGAHVyx3cv
VYMAoKCCknAxWx4zUDFL3fvhLfhRqTnY
=Hr+Y
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to