[Catalyst] How do I make my class dbi Model classes a subclass of
Sebastian Riedel
sri at oook.de
Mon May 2 19:23:43 CEST 2005
Am 02.05.2005 um 18:40 schrieb Anthony Lee:
> Thanks for the upgrade information.
> The inheritance seems to work without any errors or wraning now,
> when using Catalyst::Model::CDBI.
> However I don't know if my upgrade was correct, but when I try
> using Catalyst::Model::CDBI::Plain I get the following problems:
>
> mk-solaris3-dev# more lib/NIM/M/CDBI.pm
> package NIM::M::CDBI;
>
> use strict;
> use base 'Catalyst::Model::CDBI::Plain';
>
> __PACKAGE__->config(
> dsn => 'dbi:Oracle:DEV4',
> user => 'lluuser',
> password => 'lluus3r',
> options => { },
> relationships => 0
> );
>
>
> mk-solaris3-dev# more lib/NIM/M/CDBI/Btinport.pm
> package NIM::M::CDBI::Btinport;
>
> use base 'NIM::M::CDBI';
> use strict;
>
> __PACKAGE__->table('btinport');
> __PACKAGE__->columns(All => qw/btinportid btincardname
> cardportlocation/);
>
> 1;
>
> mk-solaris3-dev# ./script/nim_test.pl
> [Mon May 2 16:22:06 2005] [catalyst] [debug] Debug messages enabled
> [Mon May 2 16:22:06 2005] [catalyst] [debug] Loaded dispatcher
> "Catalyst::Dispatcher"
> [Mon May 2 16:22:07 2005] [catalyst] [debug] Loaded engine
> "Catalyst::Engine::Test"
> [Mon May 2 16:22:07 2005] [catalyst] [debug] Found home "/u01/dev/
> NIM/script/.."
> Use of 'new' is deprecated at /usr/local/lib/perl5/site_perl/5.8.5/
> Catalyst/Model/CDBI/Plain.pm line 15. Use 'create' instead
> Couldn't instantiate "NIM::M::CDBI::Btinport", "create needs a
> hashref at /usr/local/lib/perl5/site_perl/5.8.5/Module/Pluggable/
> Fast.pm line 104
> " at /usr/local/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 665
> [Mon May 2 16:22:07 2005] [catalyst] [debug] Loaded components
>
> I couldn't see any information on the archive lists, and was
> wondering if this is something I've done wrong ??
>
> again any information is much appreciated.
Yes, it's broken, we'll upload a fixed version soon.
For now you can just remove this line.
*{"$class\::new"} = sub { Class::DBI::new(@_) };
--
sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050502/a65bdaeb/attachment.html
More information about the Catalyst
mailing list