Thursday, November 24, 2011

Re: Using DSE when a model contains a manytomany field

On 11/24/2011 03:17 PM, Fabio Natali wrote:
> Hi everybody.
>
> I want to insert data into my Django db as I read from a CSV file.
> Everything was fine with a first model of mine.
>
> ######################################################################
> fields = ("name", "price")
> for (counter, row) in enumerate(csvReader):
> product_dict = dict(zip(fields, row))
> Product.delayed.insert(product_dict)
> Product.delayed.flush()
> ######################################################################
>
> Now I am dealing with another model which contains a manytomany field.
> Can I use DSE now? Which syntax am I supposed to use?
>
> Kind regards, Fabio.

I'm thinking to leave DSE and try this:
https://docs.djangoproject.com/en/dev/topics/db/transactions/#controlling-transaction-management-in-views

Tips or ideas are welcome.

--
Fabio Natali

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate