[Catalyst] Schema::Loader and Catalyst::Helper::Model::Scaffold
Matt S Trout
dbix-class at trout.me.uk
Tue May 30 01:11:14 CEST 2006
Mauro Andreolini wrote:
> 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.
Scaffold was written for Class::DBI and the author has since left the
Catalyst project entirely.
Have a look at Catalyst::Example::InstantCRUD for a DBIx::Class CRUD
More information about the Catalyst