On Tue, May 08, 2007 at 12:42:03PM +0400, Oleg Pronin wrote:
> I'm not sure. Possible version of your problem.
>
> TT evaluates your expression in LIST contex (it does internally
> $stash->get(...) which works in list context in ::Stash::XS i suppose).
>
> Therefore when you call
> rs.search(1).search(2).all,
> rs.search is executed in list context and not a resultset returned!
>
> To solve the problem, use subexpressions (between periods (".")) that do not
> depend on context.
>
> rs.search_rs(1).search_rs(2).all
>
> In case of relationships:
>
> Instead of
>
> [% list = user.categories.search(COND) %]
>
> Use
> [% list = user.related_resultset('categories').search(COND) %]
or [% user.categories_rs %] which DBIC started generating for a has_many rel
a while back as a workaround for this exact bit of TT brain damage
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
_______________________________________________
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]/