[Catalyst] Using relations in catalyst

Wijnand Wiersma wijnand at nedbsd.nl
Tue Aug 23 20:24:57 CEST 2005


So, finally able to look into this.

Zbigniew Lukasiak wrote:

>First perhaps you have the item in your templates as 'item' not
>'pr_ping_def'?  So you should have 'item.server.name' in the template.
>
>You can also try the 'Stringify' feature of CDBI:
>
>__PACKAGE__->columns(Stringify => qw/name/);
>
>Read about it in perldoc Class::DBI. 
>  
>
Yes, I have included that.

>Then you can try to extract the problem from the whole application -
>write a short script using the model.  Something like:
>
>use Jabbernet::M::CDBI::PrPingDef;
>
>my $x = Jabbernet::M::CDBI::PrPingDef->retrieve(1);
>print $x->server . "\n";
>print $x->server->name . "\n";
>
>  
>
And this fails.
Can't locate object method "retrieve" via package 
"Jabbernet::M::CDBI::PrPingDef" at test.pl line 6

And that seems to be normal since there is no 'base base' statement, so 
that method will not be there automatically.

But when I looked at the code I noticed I placed it in the wrong 
position :-(
it was before the
=cut
line.....

No wonder it didn't work :-)
Sorry for the noise, and thanks for being helpfull guys.

Wijnand



More information about the Catalyst mailing list