kiddouk / redisco

A Python Library for Simple Models and Containers Persisted in Redis
MIT License
438 stars 78 forks source link

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

Open kishorpawar opened 8 years ago

kishorpawar commented 8 years ago
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.