From: Chris W. <ch...@cw...> - 2004-01-05 04:39:38
|
On Jan 3, 2004, at 6:04 PM, Vsevolod (Simon) Ilyushchenko wrote: > Welcome back and happy new year! Thanks, and the same to you! I've also been heads down on a separate project that will hopefully get released soon.... > A couple of issues cropped up: > > 1. Why do you lowercase field names? Can this be a configuration > option instead? Where is this giving you a problem? I probably did this to ensure that everything was handled consistently internally. > 2. This is probably asking for too much, but is it possible to call > fetch_group on classes with 'has_a' and 'link_to' attributes with the > 'where' filters specifying fields of the dependent classes? Unless I > missed the official way of doing this, I have to do it manually for > now. (If you do decide to implement this, keep in mind the fun issue > of inner vs outer joins - a search for the null value of the dependent > field may return valid top-level rows that do not have dependent > records). I'm not exactly sure what you mean, but you can specify join clauses in the fetch_group: my $people = Person->fetch_group({ where => "address.city = ? AND person.address_id = address.address_id, from => [ 'address', 'person' ], value => [ 'Pittsburgh' ], }); I'll make a change so you don't need to add 'person' (the table of the class we're querying) to the 'from' list. (That's kind of annoying...) You can also pass where clauses to the generated links_to method. The attached script is an example (standalone, uses SQLite). Beyond that... the whole links_to/fetch_by stuff has been kind of stagnant for quite some time. It needs to be revisited and perhaps rethought a bit... > I also sent a couple of questions around Christmas time - hopefully > you'll find them among the deluge of spam. :) I'll try and find them :-) Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |