[Kc] DBIx::Class::ResultSet / Template Toolkit / Aggregate Group By

Jonathan Otsuka djgoku at gmail.com
Wed Jun 10 10:15:28 PDT 2009


Catatlyst code in Controller:

  $c->stash->{stuff} = [
         $c->model('DB::Blah')->search(
             {},
             { select => ['data', { count => 'data' }], group_by =>  
['data '] }
         )
     ];

DataDumper Info:

  'MyApp::Model::DB::Blah' ),
bless( {
'_source_handle' => bless( {
'source_moniker' => 'Blah',
'schema' => $VAR1->[0]{'_source_handle'}{'schema'}
}, 'DBIx::Class::ResultSourceHandle' ),
'_in_storage' => 1,
'_column_data' => {
'HASH(0x227bc00)' => '59', <--I need to access this value from the  
template
'data' => '1000'
}
}, 'MyApp::Model::DB::Blah' ),
bless( {
'_source_handle' => bless( {
'source_moniker' => 'Blah',
'schema' => $VAR1->[0]{'_source_handle'}{'schema'}
}, 'DBIx::Class::ResultSourceHandle' ),
'_in_storage' => 1,
'_column_data' => {
'HASH(0x227bc00)' => '71', <--I need to access this value from the  
template
'data' => '2000'
}

Template Info:

[%   FOREACH s IN stuff %]
<tr>
<td>[% s.data %]</td>
<td>[% s.? %]</td> <-- I am not sure how to access this value in the  
template
</tr>
[% END %]

I can access data scalar just fine, but am not sure how to handle the  
HASH.

Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kc/attachments/20090610/572e3e2d/attachment.html>


More information about the kc mailing list