Christopher H. Laco wrote: >> If you want to do ad-hoc queries with filters, either use the Manager >> directly, or create your own object methods that wrap the appropriate >> manager calls: >> >> package Cart; >> ... >> sub get_items >> { >> my($self, %args) = @_; >> # Clause that links items to this cart >> push(@{$args{'query'}}, cart_id => $self->id); >> return CartItem::Manager->get_items(%args) >> } > > > That's pretty much what I had in mind if there wasn't anything else. > The trick is to use the correct meta info to set the query rather than > hard coding pk/fk column names. > > Thanks, > -=Chris
Speaking of such things... IS it necessary to configure both the foreign_keys and relationship meta information, or will just going relationships do in most cases?
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object