Re: [Catalyst] Creating a thin Model

2007-05-22 Thread Jamie Neil
Matt S Trout wrote: If you get stuck, could you start a fresh thread, please? I think this one has officially got confused now :) Ok. Just for the record though, this seems to be working fine so far: package MySite::Model::Widget; use strict; use warnings; use base qw/Catalyst::Model/; use

Re: [Catalyst] Creating a thin Model

2007-05-21 Thread Jamie Neil
Christopher H. Laco wrote: Personally, I almost always do: sub COMPONENT { my $self = NEXT::new diddle config...return $self } Sorry...that pseudo code was too vague: sub COMPONENT { my $self = shift-NEW::new(@_); $self-{'noncatclass'} = NonCatClass-new return $self } Then,

Re: [Catalyst] Creating a thin Model

2007-05-21 Thread Matt S Trout
On Mon, May 21, 2007 at 11:06:44AM +0100, Jamie Neil wrote: Christopher H. Laco wrote: Personally, I almost always do: sub COMPONENT { my $self = NEXT::new diddle config...return $self } Sorry...that pseudo code was too vague: sub COMPONENT { my $self =

Re: [Catalyst] Creating a thin Model

2007-05-21 Thread Jamie Neil
Matt S Trout wrote: use base qw/ Catalyst::Model /; sub new { my $self = shift-next::method(@_); my $class = ref($self); my ( $c, $args ) = @_; $self-{'.mymodel'} = ExternalModule-new( Catalyst::Utils::merge_hashes( $args, $self-config ) ); return $self; } sub

Re: [Catalyst] Creating a thin Model

2007-05-21 Thread Matt S Trout
On Mon, May 21, 2007 at 12:31:22PM +0100, Jamie Neil wrote: http://search.cpan.org/search?query=catalyst%3A%3Amodel+accept_context brings up most of them, but there are a few more like Net::Amazon. Looks like they were all cargo-culted from J Shirley's YouTube model. o I shall be explaining

[Catalyst] Creating a thin Model

2007-05-18 Thread Jamie Neil
Can anyone tell me the best way of wrapping a non catalyst perl module in a Catalyst Model? I'm trying to setup the following stack: MyApp::Controller::Widget MyApp::Model::Widget MyApp::Logic::Widget MyApp::Schema::DB where MyApp::Model::Widget is based on Catalyst::Model, contains the

Re: [Catalyst] Creating a thin Model

2007-05-18 Thread Christopher H. Laco
Christopher H. Laco wrote: Jamie Neil wrote: Can anyone tell me the best way of wrapping a non catalyst perl module in a Catalyst Model? I'm trying to setup the following stack: MyApp::Controller::Widget MyApp::Model::Widget MyApp::Logic::Widget MyApp::Schema::DB where

Re: [Catalyst] Creating a thin Model

2007-05-18 Thread Christopher H. Laco
Jamie Neil wrote: Can anyone tell me the best way of wrapping a non catalyst perl module in a Catalyst Model? I'm trying to setup the following stack: MyApp::Controller::Widget MyApp::Model::Widget MyApp::Logic::Widget MyApp::Schema::DB where MyApp::Model::Widget is based on

Re: [Catalyst] Creating a thin Model

2007-05-18 Thread John Napiorkowski
--- Christopher H. Laco [EMAIL PROTECTED] wrote: Christopher H. Laco wrote: Jamie Neil wrote: Can anyone tell me the best way of wrapping a non catalyst perl module in a Catalyst Model? I'm trying to setup the following stack: MyApp::Controller::Widget MyApp::Model::Widget

Re: [Catalyst] Creating a thin Model

2007-05-18 Thread Christopher H. Laco
John Napiorkowski wrote: --- Christopher H. Laco [EMAIL PROTECTED] wrote: Christopher H. Laco wrote: Jamie Neil wrote: Can anyone tell me the best way of wrapping a non catalyst perl module in a Catalyst Model? I'm trying to setup the following stack: MyApp::Controller::Widget