[Catalyst] CDBI Plain not inheriting table and columns

Matt S Trout catalyst at trout.me.uk
Mon Aug 1 23:03:27 CEST 2005


On Mon, Aug 01, 2005 at 04:37:19PM -0400, Jonathan Manning wrote:
> Hello,
> 
> Can anyone provide some example usage for CDBI::Plain with existing
> classes? I've tried using it as described in it's POD, but it's not
> working for me.
> 
> I have a command line based tool that uses CDBI classes. I'm trying to
> add a Catalyst web app while keeping the existing CDBI classes intact.
> 
> My setup is very simple:
> package CatalystApp::M::Experiment;
> use base qw[Catalyst::Model::CDBI::Plain MyOther::Obj::Experiment];
> 1;
> 
> package MyOther::Obj::Experiment;
> use base qw[Class::DBI];
> __PACKAGE__->table('Experiments');
> __PACKAGE__->columns('All' => qw/ID Name Start Stop/);
> # all my custom methods here...
> 1;
> 
> Catalyst can't find the table. The __PACKAGE__-> calls are associating
> the table and columns with MyOther::Obj::Experiment, not with the
> Catalyst::M class.

What do you mean "Catalyst can't find the table" ??

CatalystApp::M::Experiment->retrieve(...) for example should work fine.

Paste some example code from your Controller classes to explain, please.

-- 
     Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.



More information about the Catalyst mailing list