> > Without seeing a tremendous amount of your code it is hard > to answer, > but it sounds like you are either at a point where it would > be > advantageous to learn Moose, or start doing some multiple > inheritance > hacks to get things working. > > The simple approach, which is much less "great" > than using Moose, is > to put your App specific (the Catalyst specific, as you > phrased it) > methods in a class, and then in your model class: > > package MyApp::Model::Everything; > > use base qw/Catalyst::Model::DBIC::Schema > MyApp::Model::Book/; > > __PACKAGE__->config( ... ); > > 1; > > Then you can do > $c->model('Everything')->foo_method( ... ); > (foo_method defined in Model::Book), and still have > $c->model('Everything::SchemaClass')->search(...); > > In foo_method, $self will be Catalyst::Model::DBIC::Schema, > so you can > do > $self->schema->resultset('SchemaClass')->search(...); > etc. > > But really... I'd just learn Moose, it'll make > things easier and > cleaner in the long run.
The thing you suggested is already where i am now, though: i have $c->model('Book')->foo_method for my "Cat specific" stuff, and $c->model('MyApp::Book')->find($id) for my Schema stuff. I know that Moose is the way to go for the future, esp. for Catalyst's future, but is there something I can do for now if im not ready to commit to it just yet? What have people been doing up to now--there's no way to multiple-inherit so that i only have one model class to call? Jen _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/