Scott,
Thank you very much for your reply and giving me very nice and simpler
idea but I have one question:

What if field_name and value coming from loop?
I have around 50 field and values in loop.
Can I do this? I know this is silly way to do but please guide how can
I do this?

for key, value in users:
   user."%s" = "%s" % (key, value)

user.save()

Thanks for you time!!!


On May 13, 7:12 pm, zinckiwi <zinck...@gmail.com> wrote:
> > I am little confused about it. I am not sure django allow this or not.
> > Please correct me.
>
> > string = last_name = 'Riaz edit',  first_name = 'Asim edit',
> > nationality  = 'se'
> > User.objects.filter(id=11).update(string)
>
> > I am using this and its giving me this error:
>
> > update() takes exactly 1 argument (2 given)
>
> > please correct me or give me any idea how to do this.
>
> Try the simpler way:
>
> user = User.objects.get(id=11)
> user.last_name = 'Riaz edit'
> user.first_name = 'Asim edit'
> user.nationality = 'se'
> user.save()
>
> Regards
> Scott
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to