IMHO, while dealing with database data modifications from a csv file,
you should not let default commit on each save(). This will help you
preserve data from accidents (if something is wrong inside the serie,
maybe the serie shouldn't be processed) and you'll have better speed
processing these modifcations.
http://docs.djangoproject.com/en/dev/topics/db/transactions/
Le 20/03/2011 10:08, Daniel Roseman a écrit :
On Sunday, March 20, 2011 1:04:46 AM UTC, Corey Farwell wrote:
So would it look something along these lines:
from app.models import NewModel
# parse csv data here
meow = NewModel(whatever = parsedData)
meow.save()
Where should this script live? Is there a general place django
developers keep these scripts? If I want this script to run every x
minutes, would a cron job be the best approach?
You probably want a custom manage.py script:
http://docs.djangoproject.com/en/1.2/howto/custom-management-commands/
This can be run from the command line or as a cron job.
--
DR.
--
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.
--
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.