This is correct behavior. You do not have a handle on a db row. You have a reference to an instance of a python class whose attributes contain data copied from the (set of foreign key and/or join table related )db row(s). Filter is a means of preparing a new query to run against the db. When that query is executed (the filter return is evaluated) a new collection of python class instances is created and populated from what the db returns for the query. There is no awareness that you still have a reference to some other instance. The new instance of the class for the particular row will have been populated only from the databases. Changes to that other instance are private to the software holding a reference to it unless and until you call its save() method -- the save method of some other instance such as the one from the latter query, won't do -- at which time the ORM will compose and execute an update query on the database to set the fields in the row according to the attribute values of the instance.
Bill On Fri, Apr 23, 2010 at 3:15 PM, Margie Roginski <margierogin...@yahoo.com> wrote: > I have a situation where I have a handle to a db object and I've > modified a field in it. Then I later end up executing a filter that > finds that same object (among others) and saves all of the objects it > finds. In this situation the modified fields do not get saved out. > It's like the filter is getting the object directly from the database, > as opposed to getting the object that is in memory and modified (but > not yet saved). > > Is this the expected behavior? > > Margie > > -- > 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. > > -- 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.