Hi,

There's one minor issue that I'm not entirely clear of with this proposal:

On Sunday 12 May 2013, Anssi Kääriäinen wrote:
> 
> Concrete API proposal: Model.refresh() reloads all non-deferred local
> field values (that is, all fields in the current model which have a
> database column). In addition refresh() will make sure that cached
> values dependent of the reloaded values will be cleared. That is, if
> you do foo.refresh(), then when foo.user_id is reloaded foo.user will
> be cleared (assuming the reloaded user_id is different from the
> original value). This is to ensure that next access to foo.user will
> reload the related object, too.
> 

The limitation (assuming the reloaded user_id is different from the
original value) does make sense; removing it also makes sense -- then, after 
foo.refresh(), foo.user will always get the updated user  object (and always 
incur a database hit).

Relatedly, we now cache back-references of 1-to-1 relations on the instance; 
those should probably be updated (on remote objects!) too, or else some 
serious inconsistencies may be created (when the _id field changes, that is).

Other than that, +1.

Shai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to