On 10/25/07, John Siracusa <[EMAIL PROTECTED]> wrote: > On 10/25/07, Arshavir Grigorian <[EMAIL PROTECTED]> wrote: > > I found an old post on the subject > > (http://osdir.com/ml/lang.perl.modules.dbi.rose-db-object/2006-08/msg00077.html) > > but am not sure how to implement this in a one-to-many context. > > The approach is the same, just the details are different. A better > way to do this kind of thing is sorely needed, and is planned > (eventually...) In the meantime, below is a fairly robust way to > implement it for any relationship (though the details for a 1-to-many > "prices" relationship are hard-coded in the method). You can call it > with filters too: > > $foo_avg = $o->average_price([ name => { like => 'Foo%' } ]); > > -John >
Worked beautifully. Thank you, John. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object