[Catalyst] Relationship layout

Will Smith willbelair at yahoo.com
Mon Oct 3 14:36:02 CEST 2005


Hi,
I've tried to define a has-many within the Control class of the app developed using Scaffold. 
My tables are: artist (artistid, name), cd (cdid, artistid - references artist, cdtitle)
 
sub myrelation : Local {
    my ( $self, $c, $id ) = @_;
    
    Music::M::CDBI::Artist->has_many(cd => 'Music::M::CDBI::Cd');
    
### what goes here - I am a bit confused    
 
    $c->stash->{template} = 'Artist/testpage.tt';
}
 
I follow the instruction of Class::DBI, but still get errors:
Caught exception "Can't locate object method "retrieve" via package "Class::DBI::Relationship::HasMany" at C:/Music/script/../lib/Music/C/Artist.pm line 153."Couldn't render template "file error - artist/myrelation: not found"
 
someone please tell me what are those magic lines that can get the data out. what I need is just the artist name and associatiated cdtitle(s)
 
Thanks


		
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20051003/cbf60b7a/attachment.htm


More information about the Catalyst mailing list