Monday, June 20, 2011

Re: Dynamic Models for CSV Importing

Thanks for the quick reply, Shawn!

The reason I wanted to use Django was so that I could leverage the ORM to allow users to do arbitrary SQL filtering/grouping before the data gets saved onto the production DB.

Assuming a 1.5 million lines CSV file (which is probably the smallest file users would upload), can I trust pymongo/MongoDB to be reliably fast? More importantly, using map/reduce and having to write custom built functions for things like aggregation would force me to reinvent the wheel considering what the Django ORM has to offer, would it not?

Finally, I still need to know if I should save the column name-type mappings as a JSONField + custom widget or as a FK to a "ColumnFieldMapping" model in my "ImportTemplate" model.

Thanks again for your insight


Sincerely,
André Terra (airstrike)





On Mon, Jun 20, 2011 at 6:44 PM, Shawn Milochik <shawn@milochik.com> wrote:
I don't see where Django comes in -- at least not for the core of the app. Python certainly, with the xlwt and xlrd modules being incredibly helpful.

Secondly, I'd use MongoDB (via pymongo) to store the temporary data, because I wouldn't bet a nickel that you'll get data in a consistent format, and xlrd (or a csv reader or DictReader) into a MongoDB document is ultra-convenient.

If you get the guts working and want to use Django as a front-end for the users then you certainly can, but I don't believe that Django's ORM has a place in the solution.

Shawn

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment