Re: [RDBO] get_objects with multiple one to many relations

2007-06-14 Thread Adrian Howard
On 14 Jun 2007, at 10:58, Adrian Howard wrote: > > On 14 Jun 2007, at 02:47, John Siracusa wrote: > >> On 6/13/07 9:29 PM, Cees Hek wrote: >>> Could you not just join the locations table twice? >> >> Actually, in the latest version, I don't think you can do that. >> But I >> wonder if I should

Re: [RDBO] get_objects with multiple one to many relations

2007-06-14 Thread Adrian Howard
On 14 Jun 2007, at 02:47, John Siracusa wrote: > On 6/13/07 9:29 PM, Cees Hek wrote: >> Could you not just join the locations table twice? > > Actually, in the latest version, I don't think you can do that. But I > wonder if I should (re)allow it. Opinions? This is one of the things I tried an

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread John Siracusa
On 6/13/07 10:24 PM, Cees Hek wrote: > Well, joining the same table twice is a valid SQL construct (similar > to doing a self join), and it can be useful in certain situations. So > I would vote to keep it... > > Was there a specific reason that it was changed? Or did it just > happen as part of

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread Cees Hek
On 6/14/07, John Siracusa <[EMAIL PROTECTED]> wrote: On 6/13/07 9:29 PM, Cees Hek wrote: > Could you not just join the locations table twice? Actually, in the latest version, I don't think you can do that. But I wonder if I should (re)allow it. Opinions? Well, joining the same table twice is

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread John Siracusa
On 6/13/07 9:29 PM, Cees Hek wrote: > Could you not just join the locations table twice? Actually, in the latest version, I don't think you can do that. But I wonder if I should (re)allow it. Opinions? -John - This SF.ne

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread Cees Hek
On 6/13/07, John Siracusa <[EMAIL PROTECTED]> wrote: > On 6/13/07, Adrian Howard <[EMAIL PROTECTED]> wrote: > > I can't see how to get_routes that have a relation ship to both a > > location with a name of 'London' and another with a name of 'Brighton'. > > Off the top of my head, this seems like y

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread Adrian Howard
On 13 Jun 2007, at 14:33, John Siracusa wrote: > On 6/13/07, Adrian Howard <[EMAIL PROTECTED]> wrote: >> I can't see how to get_routes that have a relation ship to both a >> location with a name of 'London' and another with a name of >> 'Brighton'. > > Off the top of my head, this seems like yo

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread John Siracusa
On 6/13/07, Adrian Howard <[EMAIL PROTECTED]> wrote: > I can't see how to get_routes that have a relation ship to both a > location with a name of 'London' and another with a name of 'Brighton'. Off the top of my head, this seems like you'd need two "EXISTS (...)" subqueries to do this. To use su

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread Adrian Howard
On 13 Jun 2007, at 14:18, Peter Karman wrote: [snip] > have you read > http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.764/lib/Rose/DB/ > Object/QueryBuilder.pm > > I think you just want to 2 locations.name params. [snip] I'm not seeing how to apply it - sorry. How do I signify that the two

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread Peter Karman
Adrian Howard wrote on 6/13/07 7:40 AM: > Possibly dumb question. > > I've got a route table with a one 2 many relationship with a location > table. I can see how I can use get_objects with something like: > > Route::Manager->get_routes( > query => [ > type => 'open', >

[RDBO] get_objects with multiple one to many relations

2007-06-13 Thread Adrian Howard
Possibly dumb question. I've got a route table with a one 2 many relationship with a location table. I can see how I can use get_objects with something like: Route::Manager->get_routes( query => [ type => 'open', locations.type => 'start', locations.name => 'Lond