Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread John Siracusa
On 1/30/07 11:16 PM, Jonathan Vanasco wrote: > the consensus is clearly otherwise, but let me expand my suggestions to: > > a- the name semantically notes that it doesn't alter the object > like other rose functions I think "find" expresses that pretty well already. > b- the function require a

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread Jonathan Vanasco
On Jan 30, 2007, at 7:48 PM, John Siracusa wrote: > Given that this method will always be called with arguments, and > that those > arguments can change per-call, how can there be any expectation > that the > results will be saved internally? How would such a feature even work? it wouldn't

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread John Siracusa
On 1/30/07 9:57 PM, Danial Pearce wrote: > On 1/31/07, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: >> sub fetch { >>my $self = shift; >>my $obj = $self->object_class->new(@_); >>$obj->load(speculative => 1) ? $obj : undef; >> } > > Amazing. We also use the exact same method. Well, almo

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread Danial Pearce
On 1/31/07, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: > sub fetch { >my $self = shift; >my $obj = $self->object_class->new(@_); >$obj->load(speculative => 1) ? $obj : undef; > } Amazing. We also use the exact same method. Well, almost. We golfed that shift a bit ;-) I wonder if this

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread Ask Bjørn Hansen
On Jan 30, 2007, at 12:55, John Siracusa wrote: I like it! We have all sorts of utility methods in our model classes to fetch child objects where just calling ->children wasn't exact enough. On a vaguely related note, in our manager class we have the following three methods. In particular

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread John Siracusa
On 1/30/07 7:59 PM, Danial Pearce wrote: > What happens when you call ->find_prices with no args? It's essentially the same as calling a get_set_* method: all the related objects (as determined by the relationship metadata) are returned. But if that's really what you want, you'd just call $p->pri

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread Danial Pearce
> So, does this method type seem useful? If so, what do you think of > the method type name ("find") and the default method name format > ("find_")? Ruby uses find. If it's good enough for ruby, it's good enough for me :-) I agree that it seems obvious the results won't be cached. What happens

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread John Siracusa
On 1/30/07 7:16 PM, Jonathan Vanasco wrote: >> Every call to find_prices() goes back to the database to get new rows. >> Those rows are returned, not saved in the parent object ($p) at all. > > what about temp_find , return_only_find , or something else in the > name to reflect that the results

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread Jonathan Vanasco
On Jan 30, 2007, at 3:55 PM, John Siracusa wrote: > So, does this method type seem useful? If so, what do you think of > the method type name ("find") and the default method name format > ("find_")? Finally, should this method type be > created by default for all one-to-many relationships, or s

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread John Siracusa
On 1/30/07 6:18 PM, Cees Hek wrote: >> Finally, should this method type be created by default for all one-to-many >> relationships, or should it have to be manually requested in the relationship >> setup? > > For me it is useful enough that it is worth including by default. But > as long as it is

Re: [RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread Cees Hek
On 1/31/07, John Siracusa <[EMAIL PROTECTED]> wrote: > So, does this method type seem useful? If so, what do you think of > the method type name ("find") and the default method name format > ("find_")? Yes, this is very useful. I do this type of query all the time, and it is one of the very few

Re: [RDBO] Integration with Rose::HTML::Form

2007-01-30 Thread John Siracusa
On 1/30/07, Derek Watson <[EMAIL PROTECTED]> wrote: > I am using RDBO in conjunction with Rose::HTML::Form for the first time, and > wonder if there are any guides or examples out there showing some > conventional integration techniques. Specifically, how best to use RHF's > objects returned by ob

[RDBO] Integration with Rose::HTML::Form

2007-01-30 Thread Derek Watson
Hello, I am using RDBO in conjunction with Rose::HTML::Form for the first time, and wonder if there are any guides or examples out there showing some conventional integration techniques. Specifically, how best to use RHF's objects returned by object_from_form() style methods to update database r

[RDBO] New "find" method type for one-to-many relationships

2007-01-30 Thread John Siracusa
In SVN, I've just added a new method type to one-to-many relationships (no docs yet). Right now, I'm calling it "find". It's for fetching related objects using ad-hoc queries instead of being constrained to the mapping defined in the relationship metadata itself. It has no ability to "set" relat