Re: Vague thoughts about is_a and might_be relationships

[prev] [thread] [next] [Date index for 2004/08/25]

From: James O'Sullivan
Subject: Re: Vague thoughts about is_a and might_be relationships
Date: 02:50 on 25 Aug 2004
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@xxxxxxxxx.xxx.xxxxxxxxxx.xxx for more info.

---1864826285-1930942468-1093402201=:23111
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Tue, 24 Aug 2004, Aaron Trevena wrote:

> > I had to make a few changes to get it to work the way I wanted for my
> > project:
> >
> > 1) I mapped the parent object's column methods to the child.
> > 2) I added a trigger so that if $child->update is executed the parent is
> > also updated.
> >
> > If you think this would be useful I can send a patch.  I'll probably make
> > a few more changes as the project progresses.
>
> Yes, please send me a patch. We could put the class on the wiki somewhere
> so that it is easy to update?

Ok here's the patch for those who are interested.

Sometime this week I'm going to try and get this working with
Class::DBI::AbstractSearch (most likely in a similar way to the current
search/search_like in IsA.pm) so I'll probably be sending an updated
patch when that's complete.

I've also got a patch for Class::DBI::FromCGI to get it to do the right
thing when executing create_from_cgi on a class with an is_a
relationship, but it still needs a little work.  I'm going to hold off
sending that patch until things solidify a bit with
Class::DBI::Relationship::IsA though.

Cheers,
-James



---1864826285-1930942468-1093402201=:23111
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="IsA.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0408250350010.23111@xxxxx.xxxxxx.xxx.xx>
Content-Description: 
Content-Disposition: attachment; filename="IsA.patch"

LS0tIElzQS5wbS5vbGQJMjAwNC0wOC0yNSAwMzoyMjo0MC4wMDAwMDAwMDAg
LTA1MDANCisrKyBJc0EucG0JMjAwNC0wOC0yNSAwMzoyNDo0Ni4wMDAwMDAw
MDAgLTA1MDANCkBAIC00OCwxMyArNDgsMzQgQEANCiAgICAgcmV0dXJuICgN
CiAgICAgICAgICAgICBzZWxlY3QgICAgICAgID0+ICRzZWxmLT5faW5mbGF0
b3IsDQogICAgICAgICAgICAgYmVmb3JlX2NyZWF0ZSA9PiAkc2VsZi0+X2Ny
ZWF0b3IsDQorICAgICAgICAgICAgYmVmb3JlX3VwZGF0ZSA9PiBzdWIgeyAN
CisgICAgICAgICAgICAgICAgaWYgKG15ICRmX29iaiA9ICRfWzBdLT4kY29s
dW1uKCkpIHsgJGZfb2JqLT51cGRhdGUgfQ0KKyAgICAgICAgICAgIH0sDQog
ICAgICk7DQogfQ0KIA0KIHN1YiBtZXRob2RzIHsNCiAgICAgbXkgJHNlbGYg
PSBzaGlmdDsNCiAgICAgJHNlbGYtPmNsYXNzLT5fcmVxdWlyZV9jbGFzcygk
c2VsZi0+Zm9yZWlnbl9jbGFzcyk7DQorICAgDQorICAgIG15ICVtZXRob2Rz
OyANCisNCisgICAgbXkgJGFjY19uYW1lID0gJHNlbGYtPmFjY2Vzc29yLT5u
YW1lOw0KKyAgICBmb3JlYWNoIG15ICRmX2NvbCAoJHNlbGYtPmZvcmVpZ25f
Y2xhc3MtPmFsbF9jb2x1bW5zKSB7DQorICAgICAgICBuZXh0IGlmICRmX2Nv
bCBlcSAkYWNjX25hbWU7DQorICAgICAgICAkbWV0aG9kc3skZl9jb2x9ID0g
c3ViIHsNCisgICAgICAgICAgICBteSAoJHNlbGYsICRhcmcpID0gQF87DQor
ICAgICAgICAgICAgaWYoJGFyZykgew0KKyAgICAgICAgICAgICAgICAkc2Vs
Zi0+JGFjY19uYW1lLT4kZl9jb2woJGFyZyk7DQorICAgICAgICAgICAgfQ0K
KyAgICAgICAgICAgIGVsc2Ugew0KKyAgICAgICAgICAgICAgICByZXR1cm4g
JHNlbGYtPiRhY2NfbmFtZS0+JGZfY29sOw0KKyAgICAgICAgICAgIH0NCisg
ICAgICAgIH07DQorICAgIH0NCisgICAgDQogICAgIHJldHVybigNCisgICAg
ICAgICVtZXRob2RzLA0KICAgICAgICAgc2VhcmNoICAgICAgPT4gJHNlbGYt
PnNlYXJjaCwNCiAgICAgICAgIHNlYXJjaF9saWtlID0+ICRzZWxmLT5zZWFy
Y2hfbGlrZSwNCiAgICAgICAgIGFsbF9jb2x1bW5zID0+ICRzZWxmLT5hbGxf
Y29sdW1ucywNCkBAIC0xMjUsNiArMTQ2LDcgQEANCiAgICAgICAgIG15ICRo
YXNoID0geyB9Ow0KIA0KICAgICAgICAgZm9yZWFjaCAoJHNlbGYtPl9fZ3Jv
dXBlci0+Z3JvdXBfY29scygnVEVNUCcpKSB7DQorICAgICAgICAgICAgbmV4
dCB1bmxlc3MgZGVmaW5lZCgkc2VsZi0+X2F0dHJzKCRfKSk7DQogICAgICAg
ICAgICAgJGhhc2gtPnskX30gPSAkc2VsZi0+X2F0dHJzKCRfKTsNCiAgICAg
ICAgIH0NCiANCg==
---1864826285-1930942468-1093402201=:23111--

Re: Vague thoughts about is_a and might_be relationships
James O'Sullivan 02:50 on 25 Aug 2004

is_a relationship?
Caroline Johnston 14:14 on 27 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52