Re: has_a to non-CDBI objects
[prev]
[thread]
[next]
[Date index for 2005/02/14]
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
|
|
Re: has_a to non-CDBI objects
Perrin Harkins 20:43 on 14 Feb 2005
|