Hi, I have a resultset call like this in my Catalyst application:

 

$rs = [$c->model('DB::Table1)->search(

            { .

            },

            { join => [ .]

            }

         )];

 

The reason for the brackets is, in my tt2 file, I can make a call directly
to the table column: 

[% FOREACH result IN rs %]

   [% result.table1.column1 %]

[% END %]

and it works perfectly.

 

But, now I want to make other calls from within my perl code, using my $rs
variable, like $rs->count, etc.  But, I have to remove the brackets, which
causes me to lose the ability to access the table information in the tt2
file.

 

How can I have both?  The error I get if I leave the brackets on is:

"Can't call method "count" on unblessed reference at .

 

Incidentally, I have remembered to put 'add_columns' in all of my
DB::TableX.pm files with all the columns for that table.

 

I have tried things like, leaving the brackets off above, and then sending
$rs_ref = [$rs] to the stash instead of $rs, sending \$rs, etc.

 

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to