[Catalyst] FW: Inheriting existing CDBI model objects

Carl Vincent C.A.Vincent at newcastle.ac.uk
Wed Mar 15 16:24:23 CET 2006


Hi

I'm trying out Catalyst (5.66) for the first time.

I've followed the example
http://dev.catalyst.perl.org/wiki/MoviesScaffoldingDemoTranscript
to create a scaffolded CRUD, and I'm using the method from the cookbook
to wrap them in Catalyst::Model classes:

package ContactMgr::Model::Contact::Person;
use strict;
use warnings;
use base qw/Catalyst::Model Netskills::Contact::Person
Class::DBI::FromForm Class::DBI::AsForm /;
1;

The scaffolded system "kind of works" - list shows the right column
headings, and the right number of "View Edit Destroy" links for the
number of rows in the database. However it doesn't show any of the field
values....

Outputing a Data::Dump shows the item passed in the stash to the view
doesn't contain much:
$VAR1 = bless( {
                 'person' => '189'
               }, 'ContactMgr::Model::Contact::Person' );

My CDBI stuff is pretty basic - the only unusual thing I do is instead
of specifying the connection info in the DBI base class, I specify it at
runtime. I've put the connection line in my top level application pm
file:
 
Netskills::Contact::DBI->connection('DBI:mysql:database=contacts-test;ho
st=dbserver.example.com','catalyst','asecret');

This works in all my other apps - and it seems that Catalyst is
connecting up ok, as it knows the primary keys of all the objects...

Does anyone have any clues to this?

Thanks

Carl

       -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
       Carl Vincent             http://www.netskills.ac.uk/ (URL)
       Systems Manager                       0191 222 5003 (voice)
       NETSKILLS - Quality Internet Training 0191 222 5001  (fax)



More information about the Catalyst mailing list