[Catalyst] Catalyst::Model::CDBI

Jesper Krogh jesper at krogh.cc
Thu Oct 6 19:10:44 CEST 2005


Toby Corkindale wrote:
>>Yes.. but doesn't that solutoin assumes that I have a "model" class?
>>I dont, since it uses Class::DBI::Loader to load the database model.
> 
> 
> Ah, but you can still create Model classes to extend the automagically created
> ones.

Magic.. nice :-)

> ie. if Class::DBI::Loader is creating a Catalyst class called
> Foo::M::CDBI::Bar, then go into $lib/Foo/M/CDBI and vim Bar.pm
> 
> ------8<--------
> Package Foo::M::CDBI::Bar;
> use strict;
> use warnings;
> __PACKAGE__->columns(Essential => qw/id nick name cdate/);
> 1;
> ------>8--------
> 
> The DB autoloading is still done, but that package is autoloaded and used to
> extend the options/features.

Thanks a lot.. and to Michele too.

-- 
Jesper Krogh



More information about the Catalyst mailing list