[Catalyst] CDBI Plain not inheriting table and columns

Jonathan Manning jmanning at alisa-jon.net
Mon Aug 1 22:37:19 CEST 2005


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.

Should I change __PACKAGE__ to something else in my class? How can I get
that to inherit properly?

Thanks,
~J




More information about the Catalyst mailing list