Re: one to one revisited (has_own)
[prev]
[thread]
[next]
[Date index for 2005/01/26]
--0-244502363-1106781853=:97450
Content-Type: text/plain; charset=us-ascii
Content-Id:
Content-Disposition: inline
I have a might_have and a has_one (note 'one') relationship ready for testing.
I've given them a little work out. HasOne.pm has a synopsis of using both. I
chose has_one over has_own. If anyone has a better name i'm all ears. Maybe
has_own could be an alternative to a has_a relationship as i originally
thought. Maybe better just to add an extra arg for the meta data instead of
making a whole new relationship. Same could be said for has_one and might_have
but since the whole point was to take the "might" out of it a new relationship
seems warranted.
Here is the synopsis and attached are the files. Except for where i noted with
"# pjs ...", they are both copies of original CDBI::Relationship::MightHave.pm.
Thanks.
=head1 NAME
Class::DBI::Relationsip::HasOne -
Like might_have without the might. Offers a small but significant
improvement in program readability and CDBI tuning.
=head1 SYNOPSIS
# Example with experimental has_one and might_have
# Below not tested but code just like it was.
package Music::CD;
Music::CD->add_relationship_type(
'has_one' => 'Class::DBI::Relationship::HasOne');
Music::CD->columns(All => qw/cd_id .../);
Music::CDArtist->columns(All =>
qw/cd_id artist_type artist_id instrument/);
Music::CD->has_one(primary_artist => Music::CDArtist =>
qw(artist_id),{_FK_=>'cd_id', artist_type =>'primary'}
);
Music::CD->might_have(secondary_artist => Music::CDArtist =>
qw(), {_FK_=>'cd_id', artist_type => 'secondary'}
);
Music::CD->might_have(cover_artist => Music::CDArtist =>
qw(), {_FK_=>'cd_id', artist_type => 'graphic'}
);
# Old style should still work
Music::CD->might_have(liner_notes => LinerNotes => qw(notes));
# And maybe a new has_many style that takes limiters ?
Music::CD->has_many(band_members => Music::CDArtist,
{ _FK_ => 'cd_id', order_by => 'instrument',
artist_type => 'band_member'
}
);
# And to make it all worth while . . .
sub create_new {
my $self = shift;
my $req_components = $self->meta_info('has_one');
my $opt_components = $self->meta_info('might_have');
my %cgi = $self->to_cgi; # get inputs from AsForm
foreach my $comp (keys %$req_components) {
my $fclass = $req_components->{$comp}->{foreign_class};
$cgi{$comp} = $fclass->to_cgi;
}
my $template_args = {
cgi => $cgi,
opt_components => $opt_components
};
}
# ... accessing in TT templates
[% cd.primary_artist; %]
[% cd.secondary_artist;%]
[% flute_players = cd.band_members('instrument' , 'flute')%]
# A Comparison: do above with with just a has_many
...
Music::CD->has_many(artists => "Music::CDArtist");
...
sub create_new_cd {
my $self->shift;
my $required_components = ;
# This isn't fun anymore.
}
# accessing in TT templates
[% primary = cd.artists('artist_type' , 'primary');
# hopefully %]
[% secondary = cd.artists('artist_type' , 'secondary')%]
[% flute_players = cd.artists('instrument' , 'flute')%]
=====
pjs
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--0-244502363-1106781853=:97450
Content-Type: application/x-perl; name="MightHave.pm"
Content-Transfer-Encoding: base64
Content-Description: MightHave.pm
Content-Disposition: attachment; filename="MightHave.pm"
cGFja2FnZSBDbGFzczo6REJJOjpSZWxhdGlvbnNoaXA6Ok1pZ2h0SGF2ZTsK
dXNlIHN0cmljdDsKdXNlIHdhcm5pbmdzOwoKdXNlIGJhc2UgJ0NsYXNzOjpE
Qkk6OlJlbGF0aW9uc2hpcCc7CnVzZSBEYXRhOjpEdW1wZXI7IAoKc3ViIHJl
bWFwX2FyZ3VtZW50cyB7CglteSAoJHByb3RvLCAkY2xhc3MsICRtZXRob2Qs
ICRmX2NsYXNzLCBAbWV0aG9kcykgPSBAXzsKCSRjbGFzcy0+X3JlcXVpcmVf
Y2xhc3MoJGZfY2xhc3MpOwoKCSMgcGpzIC0tIHB1dCBjb25zdHJhaW50cyBh
bmQgY29sdW1uIG5hbWUgaW4gYXJncyAKCW15ICgkY29uc3RyYWludHMsICRm
X2NvbCkgPSAoe30sJycpOyAKCSRjb25zdHJhaW50cyA9IHBvcCBAbWV0aG9k
cyAgaWYgKHJlZiAkbWV0aG9kc1stMV0gZXEgIkhBU0giKTsKCSRmX2NvbCA9
IGRlbGV0ZSAkY29uc3RyYWludHMtPntfRktffSB8fCAkZl9jbGFzcy0+cHJp
b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106781853=:97450
Content-Type: application/x-perl; name="HasOne.pm"
Content-Transfer-Encoding: base64
Content-Description: HasOne.pm
Content-Disposition: attachment; filename="HasOne.pm"
cGFja2FnZSBDbGFzczo6REJJOjpSZWxhdGlvbnNoaXA6Okhhc09uZTsKdXNl
IHN0cmljdDsKdXNlIHdhcm5pbmdzOwoKdXNlIGJhc2UgJ0NsYXNzOjpEQkk6
OlJlbGF0aW9uc2hpcCc7CgpzdWIgcmVtYXBfYXJndW1lbnRzIHsKCW15ICgk
cHJvdG8sICRjbGFzcywgJG1ldGhvZCwgJGZfY2xhc3MsIEBtZXRob2RzKSA9
IEBfOwoJJGNsYXNzLT5fcmVxdWlyZV9jbGFzcygkZl9jbGFzcyk7CgkjIHBq
cyAtLSBwdXQgY29uc3RyYWludHMgYW5kIGZvcmVpZ24gY29sdW1uIG5hbWUg
aW4gYXJncyAKCW15ICgkY29uc3RyYWludHMsICRmX2NvbCkgPSAoe30sJycp
OyAKCSRjb25zdHJhaW50cyA9IHBvcCBAbWV0aG9kcyAgaWYgKHJlZiAkbWV0
aG9kc1stMV0gZXEgIkhBU0giKTsKCSRmX2NvbCA9IGRlbGV0ZSAkY29uc3Ry
YWludHMtPntfRktffSB8fCAkZl9jbGFzcy0+cHJpbWFyeV9jb2x1bW47ICAK
CXJldHVybiAoJGNsYXNzLCAkbWV0aG9kLCAkZl9jbGFzcywgCgkJeyBmb3Jl
aWduX2NvbHVtbiA9PiAkZl9jb2wsIGNvbnN0cmFpbnRzID0+ICRjb25zdHJh
aW50cywgCgkJICBpbXBvcnQgPT4gXEBtZXRob2RzIAoJCX0KCSk7Cn0KCnN1
YiB0cmlnZ2VycyB7CglteSAkc2VsZiA9IHNoaWZ0OwoKCW15ICRtZXRob2Qg
PSAkc2VsZi0+YWNjZXNzb3I7CgoJcmV0dXJuICgKCQliZWZvcmVfdXBkYXRl
ID0+IHN1YiB7CgkJCWlmIChteSAkZm9yX29iaiA9IHNoaWZ0LT4kbWV0aG9k
KCkpIHs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