hello,
i have a queryset and a model with a manytomany-relationship, let's
say a pizza has toppings.
my pizza margharita has already some toppings and now i retrieve a
queryset of some more and want to add them to the pizza:
for topping in toppings:
pizza.toppings.add(topping)
the problem is: everytime i call add, the pizza is stored again in the
database and an insert statement is done. how can I avoid this? for my
case it would be much better if I could do something like:
pizza.toppings.add(toppings)
to add all toppings in one step.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---