[Catalyst] Some guidance needed please
Ian Docherty
catalyst at iandocherty.com
Thu Sep 13 12:32:10 GMT 2007
My application has (effectively, subject to some cut and paste) the
following.
################
package MyApp::Schema;
use strict;
use warning;
use base qw(DBIx::Class::Schema);
__PACKAGE__->load_classes(qw(
UsedPassword
));
1;
################
package MyApp::Schema::UsedPassword;
use strict;
use warning;
use base qw(DBIx::Class);
__PACKAGE__->load_components(qw(PK::Auto Core));
__PACKAGE__->table('used_password');
__PACKAGE__->add_columns(qw(id user password));
__PACKAGE__->set_primary_key('id');
sub create_limited {
my ($self, $user, $password) = @_;
# password checking logic here
}
1;
################
package MyApp::Model::DBIC;
use strict;
use warning;
use base qw(Catalyst::Model::DBIC::Schema);
__PACKAGE__->config(
schema_class => 'MyApp::Schema',
connect_info => [
MyApp->config->{db},
MyApp->config->{db_user},
MyApp->config->{db_password},
{AutoCommit => 1, quote_char => '`', name_sep => '.'},
]);
1;
################
As I mentioned, if I try to do a call to
$c->model('DBIC::UsedPassword')->create_limited( ... ); I get the fatal
error
Can't locate object method "create_limited" via package
"DBIx::Class::ResultSet
Which is why I think this is not the approach, unless you know otherwise?
Regards
Ian
More information about the Catalyst
mailing list