Re: saving many2many relations

2007-07-17 Thread zenx
Thank you Rajesh, I didn't knew that. I will try your solution. Thanks! On 11 jul, 23:16, RajeshD <[EMAIL PROTECTED]> wrote: > Hi, > > > Anyone knows where the problem is? > > If you are using the Admin app to populate tags then the automatic > manipulators first call Receta.save() followed by

Re: saving many2many relations

2007-07-11 Thread RajeshD
Hi, > Anyone knows where the problem is? If you are using the Admin app to populate tags then the automatic manipulators first call Receta.save() followed by setting the models M2M field. This wipes out your changes to etiquetas inside Receta.save() One solution is to add get_tags and set_tags

Re: saving many2many relations

2007-07-11 Thread zenx
Thank you Collin, I tried that before posting in this group but the same thing happened: I get no errors when saving but Tags still remain not asociated with Receta. class Receta(models.Model): def save(self): from django.template.defaultfilters import slugify tags = se

Re: saving many2many relations

2007-07-10 Thread Collin Grady
A ManyToManyField is not a list to be replaced - add the new tags directly to etiquetas using the .add() method on it. On Jul 10, 9:34 am, zenx <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to get a list of tags separated by a comma and be able to > save them as related objects for the curren

saving many2many relations

2007-07-10 Thread zenx
Hi, I would like to get a list of tags separated by a comma and be able to save them as related objects for the current object. Currently I have this code. When saving a Receta object it creates the tags objects if they doesn't exist yet and it should save the relations between Tags and Receta, b