On 2/6/07, Antonio <[EMAIL PROTECTED]> wrote:
> Hi all,
> I have a class with a many2many field:
...
> but when I update the data the old rims are deleted and the new inserted ...
> is
> possible to UPDATE the rims data ? cioe', is possible to leave unchanged the
> rims data if are the same ?
data.rims.add(req.POST.getlist('rims'))
should do what you need it to do, assuming what has been posted is a
list of valid primary keys or object instances.
data.rims is a descriptor; it behaves a lot like an attribute (because
it has __get__ and __set__ implementations), but it also has some
helpful utility methods (like add(), remove() and clear()).
Yours,
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---