[Catalyst] Schema::Loader and Catalyst::Helper::Model::Scaffold

Mauro Andreolini andreoli at weblab.ing.unimo.it
Tue May 30 00:29:32 CEST 2006

Hi everyone,

I have successfully a Catalyst application, generating a model through
the Catalyst::Helper::Model::DBIC::SchemaLoader class. Now, I would like
to add basic CRUD-like functionality. To this purpose, I have used the
Catalyst::Helper::Controller::Scaffold module to create the Admin
controller, that is supposed to handle the Tdtp table:

script/app_create.pl controller Admin::Tdtp Scaffold app::Tdtp

I have also added the following lines to lib/app/M/app.pm:

    schema_class => 'app::SchemaLoader::app',
    additional_base_classes => [qw/Class::DBI::AsForm

Browsing to the http://localhost:3000/app/admin/tdtp url, i see
something really strange: the column names of the Tdtp table (that is, a
simple id and a name varchar) are displayed, but not their content.
Furthermore, whenever I try to add some content, I get an error about
empty fields (that I can't enter, because I see no form).
If I turn debugging on, I see a "primary_column is undefined" error. The
primary_column method is defined in the DBI::Class module, while I am
using the DBIx::Class::Schema::Loader module. So my question is: can I
use the Scaffold helper with DBIx, or do I have to turn to other
alternatives? In the latter case, are there any simple scaffolding
facilities that work with DBIx?
Thanks for your interest.

Best regards
Ing. Mauro Andreolini - Ph.D., Research Associate
Dipartimento di Ingegneria dell'Informazione
Università di Modena e Reggio Emilia - Italia
e-mail: andreolini.mauro at unimore.it
www: http://weblab.ing.unimo.it/people/andreolini/
tel: +39 059 2056256, fax: +39 059 2056129

More information about the Catalyst mailing list