I ran into this just the other day, too.  It has specifically to do
with the nested relationship + fetching a subsest of columns.  You can
do it, but you have to use a "join" instead of a "prefetch" and then
clarify things a bit further with an "as".  Try this:

$c->stash->{routes} = $c->model('QDB::Routes')->search(
                 {
                         'me.net_id'    => $c->stash->{net_id},
                         'me.route_beg' => $c->stash->{node_id_beg},
                         'me.route_end' => $c->stash->{node_id_end},
                 },
                 {
                         join => { 'xc_params' => 'nodes' },

                         columns  => [qw/
                         me.route_id me.route_beg me.route_end
me.err_code me.comment me.net_id
                         xc_params.node_rank xc_params.ch_beg xc_params.ch_end
                         nodes.node_id nodes.node_name
                         / ],

                         as  => [qw/
                         route_id route_beg route_end err_code comment net_id
                         xc_params.node_rank xc_params.ch_beg xc_params.ch_end
                         xc_params.nodes.node_id xc_params.nodes.node_name
                         / ],

                         #TODO Paged output
                         order_by => [ @order_by ],
                         page     => $page,       # page to return
(defaults to 1)
                         rows     => $rows,       # number of results per page,
                         cache => 1
                 }
         );

Note that you have to reflect the nested relationship in the naming of
the "as" attribute.

Try that and see if it works for you.

_______________________________________________
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