[Dbix-class] problem accessing stored procedure
Brett Gardner
brett at clientcomm.com.au
Mon Oct 30 10:07:24 GMT 2006
Only columns defined in your the "Notes::DBI::User" object's
"add_column(s)" methods get accessors.
You have to access this field by
my $authenticated = $user->get_column('is_authorized') eq '1' ? 1 : 0;
Devin Austin wrote:
> hey everyone,
>
> I'm attempting to select the userid and count(*) from my Users table
> where username=$q->param('username') and
> password=$q->param('password'), using the following code:
>
> my $user = $schema->resultset('User')->single(
> {
> username => $q->param('username'),
> password => $q->param('password')
> },
> {
> select => [
> 'userid', { count => '*' }
> ],
> as => [qw/userid is_authorized/],
> }
> );
>
> my $userid = $user->userid;
> my $authenticated = $user->is_authorized eq '1' ? 1 : 0;
>
>
> I'm getting this error:
>
> "Can't locate object method "is_authorized" via package
> "Notes::DBI::User" at Notes.pm <http://Notes.pm> line 323"
>
>
> Line 323 is my $authenticated = $user->is_authorized eq '1' ? 1 : 0;.
> I've read the docs
> <http://search.cpan.org/%7Edanieltwc/DBIx-Class-0.07002/lib/DBIx/Class/Manual/Cookbook.pod#Using_database_functions_or_stored_procedures>,
> but have had no success in grokking them or getting things to work.
>
> Ideas?
>
>
>
> --
> timorperfectus.com <http://timorperfectus.com> - web design to
> frightening perfection.
>
>
> One last song
> Given to an Angel's Son
> As soon as you were gone
> As soon as you were gone
>
>------------------------------------------------------------------------
>
>_______________________________________________
>List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
>Wiki: http://dbix-class.shadowcatsystems.co.uk/
>IRC: irc.perl.org#dbix-class
>SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
>Searchable Archive: http://www.mail-archive.com/[email protected]/
>
More information about the Dbix-class
mailing list