[Dbix-class] problem accessing stored procedure

Devin Austin devin.austin at gmail.com
Mon Oct 30 16:46:36 GMT 2006


when i use that, i get "DBIx::Class::InflateColumn::get_column(): No such
column 'is_authorized' at Notes.pm line 323".

Code:
my $authenticated =3D $user->get_column('is_authorized') eq '1' ? 1 : 0;



On 10/30/06, Jess Robinson <castaway at desert-island.demon.co.uk> wrote:
>
>
>
> On Mon, 30 Oct 2006, Devin Austin wrote:
>
> > hey everyone,
> >
> > I'm attempting to select the userid and count(*) from my Users table
> > where username=3D$q->param('username')
> > and password=3D$q->param('password'), using the following code:
> >
> > my $user =3D $schema->resultset('User')->single(
> >>        {
> >>            username =3D> $q->param('username'),
> >>            password =3D> $q->param('password')
> >>        },
> >>        {
> >>          select =3D> [
> >>            'userid', {  count =3D> '*' }
> >> ] ,
> >>          as =3D> [qw/userid is_authorized/],
> >>        }
> >> ) ;
> >>
> >>      my $userid =3D $user->userid;
> >>      my $authenticated =3D $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 line 323"
> >
>
> Yup, you're missing the part of the AS docs which says:
>
> If there's already an accessor with the name given in the as list, it will
> be used, otherwise you'll need to use get_column('is_authorised') instead.
>
> Or words to that effect. If there's no "is_authorized" column already, you
> can only access it using get_column.
>
> Jess
>
>
> _______________________________________________
> 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/dbix-class@lists.rawmode.org/
>



-- =

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jules.scsys.co.uk/pipermail/dbix-class/attachments/20061030/86f=
533ec/attachment-0001.htm


More information about the DBIx-Class mailing list