[jifty-devel] Using OR in a Collection->limit
Henry Baragar
Henry.Baragar at instantiated.ca
Thu Oct 12 10:44:35 EDT 2006
Hello,
We need to be able to select rows
select * from Trade where tdate = '2006-10-11' and (buyer = 21 or seller = 21)
Here is our attempt using a Jifty collection:
$date = '2006-10-11';
$cust = 21;
my $trades= Billing::Model::TradeCollection->new;
$filled->limit(column => "tdate", value => $date);
$filled->limit(column => "buyer", value => $cust);
$filled->limit( entry_aggregator => 'or',
column => "seller", value => $cust);
The "OR" never gets into the select clause: The last two limit's are "AND"ed.
What are we doing wrong? How do we fix this?
Regards,
Henry
More information about the jifty-devel
mailing list