Re: has_a to non-CDBI objects

[prev] [thread] [next] [Date index for 2005/02/14]

From: Perrin Harkins
Subject: Re: has_a to non-CDBI objects
Date: 20:43 on 14 Feb 2005
On Mon, 2005-02-14 at 10:35 +0000, Carl Johnstone wrote:
> Looking at the code it comes back to the is_changed method which only checks 
> __Changed for each column. This never gets set for non-CDBI has_a fields.

Even when the referenced object is a CDBI object, it won't register as
changed unless you change it through the accessor for that column.  CDBI
doesn't try to follow relationships when detecting changes the way
Tangram does.

> It would be nicer if this functionality was there by default, and worked in 
> the is_changed (and any_changed) methods. I'd suggest the option of passing 
> a is_changed method the same way you pass in your inflate/deflate methods. 
> With the default being to do the same as above and store the initial 
> deflated value for later comparison.

Trying to detect change on associated objects (as opposed to just noting
when the foreign key is changed) would be a significant change, and hard
to get it right for all cases.  I generally prefer the current "don't
even try" method, which required the programmer to save explicitly.

- Perrin

has_a to non-CDBI objects
Carl Johnstone 10:35 on 14 Feb 2005

Re: has_a to non-CDBI objects
Charles Bailey 15:06 on 14 Feb 2005

Re: has_a to non-CDBI objects
Perrin Harkins 20:43 on 14 Feb 2005

Generated at 10:23 on 16 Feb 2005 by mariachi v0.52