[RDBO] Deleting 'one to one' object fails

2007-06-11 Thread Ovid
In my meta setup for one object, I have the following: relationships => [ suspended => { class => 'Donhost::Server::Dedicated::Suspended', column_map => { server => 'server' }, type => 'one to one', required => 0, },

Re: [RDBO] Deleting 'one to one' object fails

2007-06-11 Thread John Siracusa
On 6/11/07 8:46 AM, Ovid wrote: > And when I try to delete the corresponding object in there: > > $self->delete_suspended; > > diag Dumper($self->suspended); > > I still have a Donhost::Server::Dedicated::Suspended object in there. > > I thought, "maybe I need to save it first": You do, be

Re: [RDBO] Deleting 'one to one' object fails

2007-06-11 Thread Ovid
- Original Message From: John Siracusa <[EMAIL PROTECTED]> > > $self->delete_suspended; > > $self->save; > > diag Dumper($self->suspended); > > > > Nope: > > > > not ok 5 - cannot_reinitialize died (No foreign key named 'suspended' at > > /usr/local/lib/perl5/site_perl/5.8.7/Rose/DB/Obje

Re: [RDBO] Deleting 'one to one' object fails

2007-06-11 Thread John Siracusa
On 6/11/07 8:46 AM, Ovid wrote: > In my meta setup for one object, I have the following: > > relationships => [ > suspended => { > class => 'Donhost::Server::Dedicated::Suspended', > column_map => { server => 'server' }, > type => 'one to

Re: [RDBO] Deleting 'one to one' object fails

2007-06-11 Thread Ovid
- Original Message From: John Siracusa <[EMAIL PROTECTED]> > I can't reproduce this error with similarly (as far as I can tell) > structured relationships. Can you send me a self-contained example with > table and class definitions that reproduces the problem (by private email if > you w

[RDBO] augmenting ManyToMany default_auto_method_types

2007-06-11 Thread Michael Reece
i've been writing my own count_related() methods and just realized that RDBO should be able to create these for me (but names them related_count).. is there a better way to get related_count() methods? attachments => { type => 'many to many', map_class=> 'My

Re: [RDBO] augmenting ManyToMany default_auto_method_types

2007-06-11 Thread John Siracusa
On 6/11/07 12:14 PM, Michael Reece wrote: > is there a better way to get related_count() methods? > > attachments => { > type => 'many to many', > map_class=> 'MyDB::RelatedAttachment', > map_from => 'asset', > map_to => 'related', >

[RDBO] Column::Pg::Bytea and Lazy

2007-06-11 Thread Derek Watson
I am using Column::Pg::Bytea and loving it, but I find that the special bind_param() work that Rose does for me does not happen when updating a lazy-loading column. Is there a way to get these 2 things working together? Bytea columns are a good candidate for lazy-loading, since you likely want to

Re: [RDBO] augmenting ManyToMany default_auto_method_types

2007-06-11 Thread Michael Reece
On Jun 11, 2007, at 9:22 AM, John Siracusa wrote: > On 6/11/07 12:14 PM, Michael Reece wrote: >> method_types => [ >> Rose::DB::Object::Metadata::Relationship::ManyToMany- >>> default_auto_method_types(), >> 'count' >> ], >> }, > > Try: > > add_methods => [ 'count' ], fantast

Re: [RDBO] augmenting ManyToMany default_auto_method_types

2007-06-11 Thread John Siracusa
On 6/11/07 1:21 PM, Michael Reece wrote: > however, the error is in $@ and not $map_manager->error, so the > reason for the failure is not reported. Thanks, I correct the error propagation when I get a chance. -John - This

[RDBO] Postgresql default value for timestamp causes RDBO failure

2007-06-11 Thread Fred Cox
insert() - Invalid default timestamp: '(now() + '21 days'::interval)' at /usr/local/lib/perl5/site_perl/5.8.8/Rose/DB/Object.pm line 1106 The column definition looks like this: tsexpire | timestamp without time zone | not null default (now() + '21 days'::interval) Should I expect valid defa