Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update (.save()) do not work if the object fetched using .filter() #70

Open
kishorpawar opened this issue Oct 1, 2016 · 0 comments
Open

Comments

@kishorpawar
Copy link

kishorpawar commented Oct 1, 2016

p = Person.objects.filter(name="Granny")
# Assuming only one record fetched.
p[0].first_name = "Morgan"
p[0].last_name = "Stanley"
p.save()

Above case do not update the values in DB.
even

p[0].update_attributes(first_name="Morgan", last_name="Stanley")
p[0].save()

doesn't work.

Instead following work as expected.

p = Person.objects.get_by_id('1')
p.first_name = "Morgan"
p.last_name = Stanley
p.save()

I believe this is critical issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant