Re: Auto import files into database

2011-03-20 Thread werefr0g
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

Re: Auto import files into database

2011-03-20 Thread Daniel Roseman
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

Re: Auto import files into database

2011-03-19 Thread Corey Farwell
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

Re: Auto import files into database

2011-03-19 Thread Shawn Milochik
I recommend creating a script that reads the CSV files then creates instances of your models from that data and saves them. This will ensure that your signals (if any) fire, and that any relationship or validation errors are known immediately, rather than breaking your application later. Shawn -

Auto import files into database

2011-03-19 Thread Corey Farwell
I have a folder of files that have CSV data that I want to import into the database of data that my Django app is using. I can import the data I want with the script manually using SQL commands but I feel like there is a much more Django/pythonic way. I know how to parse CSV files with python, just