[Catalyst] Forcing scalar context in TT?

2010-12-23 Thread Alex Povolotsky
Hello! I'm writing an application that needs to count some related objects [% row.objects.count %] results in select * from objects [% row.objects.scalar.count %] yields an error [% row.search_related_rs('objects').count %] is UGLY Do I have any better solution? Alex.

Re: [Catalyst] Forcing scalar context in TT?

2010-12-23 Thread Moritz Onken
Use Template::Alloy and do [% $(row.objects).count %] Am 23.12.2010 um 16:53 schrieb Alex Povolotsky: Hello! I'm writing an application that needs to count some related objects [% row.objects.count %] results in select * from objects [% row.objects.scalar.count %] yields an error [%

Re: [Catalyst] Forcing scalar context in TT?

2010-12-23 Thread Sam Kaufman
You *could* do [% row.objects_rs.count %] to force resultset context. However, the fact that it's such a pain in the ass should tell you that you're doing something in the view that shouldn't be done there. Just stash the count from the controller, and you won't have to worry about scalar context