[Catalyst] Error calling table class method from Catalyst
Dennis Daupert
ddaupert at gmail.com
Fri Apr 3 16:05:42 GMT 2009
I'm trying to create a method in my Files.pm class file, and call it from my
Catalyst app.
The method works when called by an "offline" app outside Catalyst.
But from my Catalyst app, I get 'Unknown error' on server.pl startup.
Maybe I haven't yet figured out the right way to call the method?
Maybe something else?
Here are some bits from table class Files.pm:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
package hde::Schema::Files;
use strict;
use warnings;
use base 'DBIx::Class';
__PACKAGE__->load_components("ResultSetManager","Core");
<snip>
sub make_versioned_filename :ResultSet {
my ( $self, $project_id, $filename ) =3D @_;
yada yada
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Here's how I successfully call the method from an offline utility:
my $returned_filename =3D
$schema->resultset('Files')->make_versioned_filename( $id, $filename );
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Here are some unsuccessful call attempts from my Catalyst app:
$c->model('hde::Files')->make_versioned_filename( $id, $filename );
Unknown error
$c->model('Files')->make_versioned_filename( $id, $filename );
Unknown error
(I'm patterning this next from code in MojoMojo, that has a model class
'DBIC.pm';
my model class is HdeDB):
$c->model('HdeDB::Files')->make_versioned_filename( $id, $filename );
Unknown error
What to do?
/dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090403/fd9e2=
265/attachment.htm
More information about the Catalyst
mailing list