[Catalyst] Using relations in catalyst

Wijnand Wiersma wijnand at nedbsd.nl
Mon Aug 22 22:48:41 CEST 2005


I think (no, I am sure) I don't get it yet.
I have to Tables: pr_ping_def and server. I have setup both with a 
scaffolding controller.
I changed M/CDBI.pm to use Catalyst::Model::CDBI::Sweet
and in the M/CDBI/PrPingDef.pm I have:
__PACKAGE__->has_a( server => 'Jabbernet::M::CDBI::Server' );

I updated the default template (that get's generated when you want a 
scaffolding table) so it only displays the server and ipaddress columns. 
The server is displayed as a id.
I want the column name of the server table to be displayed instead.

I tried a lot of things, at the irc channel the suggestion was to use 
pr_ping_def.server.name, but now it doesn't output anything.

Could it be a problem that the pr_ping_def table has multiple keys?
If so, is it possible to fix this? I cannot alter the database design.

Wijnand



More information about the Catalyst mailing list