Re: delete a field( many to many)

2011-11-10 Thread jose osuna perez
Thank very much, but I don't know what's happen. I execute the next code and it's doing nothing : if request.POST.get('usuariosDelete','')!='': for i in request.POST.getlist('usuarios'): usuario=User.objects.get(id=i) datos.usuarios.remove(usuario) --

Re: delete a field( many to many)

2011-11-10 Thread Tom Evans
2011/11/10 Aleksandar Ristić : > If I understood correctly, you need to remove a user from a project. You > can do it like this: > > datos.usarios.remove(User.objects.get(id=user_id)) > datos.save() > You don't need to save() the model instance after removing an item from an M2M link - you haven't

Re: delete a field( many to many)

2011-11-10 Thread Aleksandar Ristić
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10. 11. 11 8:50, jose osuna perez wrote: > Sorry xD > Hi, i wrote the same text in a Spanish blog xD, well I explain my > problem, I have a table that has the following model: > > class Proyectos(models.Model): > titulo=models.CharField(max_length

Re: delete a field( many to many)

2011-11-09 Thread jose osuna perez
Sorry xD Hi, i wrote the same text in a Spanish blog xD, well I explain my problem, I have a table that has the following model: class Proyectos(models.Model): titulo=models.CharField(max_length=100) creacion=models.DateField(default=datetime.datetime.now) estado=models.CharField(max_l

Re: delete a field( many to many)

2011-11-09 Thread nicolas HERSOG
English please 2011/11/9 jose osuna perez > Hola, bueno les explico mi problema, tengo 1 tabla que tiene el > siguiente modelo: > > class Proyectos(models.Model): >titulo=models.CharField(max_length=100) >creacion=models.DateField(default=datetime.datetime.now) >estado=models.CharFie

delete a field( many to many)

2011-11-09 Thread jose osuna perez
Hola, bueno les explico mi problema, tengo 1 tabla que tiene el siguiente modelo: class Proyectos(models.Model): titulo=models.CharField(max_length=100) creacion=models.DateField(default=datetime.datetime.now) estado=models.CharField(max_length=30) objetivo=models.TextField(null=Tr