[RDBO] Elegant way to generically query a table?

2006-10-14 Thread James Masters
I'm trying to write generic code that will work for any table. The following does work but it's ugly. (I'm still just prototyping so please excuse the nofrills output format). I suspect I'm labouring under all sorts of naive misunderstandings. Does anyone know ways to improve this? In particul

Re: [RDBO] give an error on where => [ col_id => [] ]

2006-10-14 Thread Ask Bjørn Hansen
On Oct 13, 2006, at 16:11, John Siracusa wrote: > On 10/13/06 7:03 PM, Ask Bjørn Hansen wrote: >> I keep making variations of this mistake, >> >> Model->delete_stuff >> (where => [ foo_id => $l->id, >> bar_id => [ keys %delete_bars ], >>], >> db

Re: [RDBO] Elegant way to generically query a table?

2006-10-14 Thread John Siracusa
On 10/14/06 7:20 PM, James Masters wrote: > I'm trying to write generic code that will work for any table. [...] > > # construct manager name > my $classname = ucfirst($table); > chop($classname); > my $mgr = "GARD::".$classname."::Manager"; > > # Note: I was hoping to do > # use $mgr > # at this

Re: [RDBO] give an error on where => [ col_id => [] ]

2006-10-14 Thread John Siracusa
On 10/14/06 8:35 PM, Ask Bjørn Hansen wrote: > We are setting some other defaults with something like > >package My::DB::Object::Metadata::Base; >use base qw(Rose::DB::Object::Metadata); > >sub new { > shift->SUPER::new( >default_update_changes_only => 1, >default

Re: [RDBO] give an error on where => [ col_id => [] ]

2006-10-14 Thread Ask Bjørn Hansen
On Oct 14, 2006, at 7:04 PM, John Siracusa wrote: > Hm, I was thinking more along the lines of allow_empty_lists or > something. I like that. (Except if allowing it is the default, then "allow_*" feels a little backwards). - ask -- http://askask.com/ - http://develooper.com/ -