Re: [RDBO] serializing rose objects

2007-12-11 Thread Adrian Howard
On 7 Dec 2007, at 16:41, Ken wrote: > Hello, > > I don't know if this exists already, but I needed a way to > serialize an > entire rose object tree into json. To do this, I created the below > methods in my base Rose::DB::Object class. [snip] column_values_as_json() in Rose::DB::Object::Helpe

Re: [RDBO] Wiki spam

2007-07-11 Thread Adrian Howard
On 11 Jul 2007, at 15:10, John Siracusa wrote: > Anyone want to help me clean out spam on the RDBO wiki? I've > fallen behind > in doing it again. > > http://rose.sourceforge.net/wiki/ > > The "recent changes" page is a good place to start: > > http://rose.sourceforge.net/wiki/index.php/Specia

Re: [RDBO] Two RDBO hierarchies interfering (with test)

2007-06-30 Thread Adrian Howard
You are a star :-) On 29 Jun 2007, at 22:02, John Siracusa wrote: > On 6/26/07, Adrian Howard <[EMAIL PROTECTED]> wrote: >> On 25 Jun 2007, at 16:33, John Siracusa wrote: >>> I'd like to see a small, self-contained, >>> reproducible test case. If you could

Re: [RDBO] Two RDBO hierarchies interfering (with test)

2007-06-26 Thread Adrian Howard
On 25 Jun 2007, at 16:33, John Siracusa wrote: [snip] I'd like to see a small, self-contained, reproducible test case. If you could post one and describe how you'd like it to behave and what it actually does instead, that'd be helpful :) Attached :-) Two database (alpha and beta - schema in

Re: [RDBO] Two RDBO hierarchies interfering

2007-06-26 Thread Adrian Howard
On 25 Jun 2007, at 18:35, Randal L. Schwartz wrote: [snip] > I maintain a git tag at the point I generated my classes. > > Twice already, I've had to generate new classes, so I rollback > to that point, generate the new classes, commit a new branch, > merge that branch with strategy "ours" and the

Re: [RDBO] Two RDBO hierarchies interfering

2007-06-25 Thread Adrian Howard
On 25 Jun 2007, at 16:52, Ovid wrote: [snip] > Out of curiosity, why rely on the loader? Because it gets it right (for my particular definition of "right" :-) with no work on my part, and persisting the generated code would be work and YAGNI. > I hope you're not doing this to load all of y

Re: [RDBO] Two RDBO hierarchies interfering

2007-06-25 Thread Adrian Howard
On 25 Jun 2007, at 16:33, John Siracusa wrote: > On 6/25/07, Adrian Howard <[EMAIL PROTECTED]> wrote: >> 1) I have a single process (mod_perl) with two different RDBO >> hierarchies connecting to two different databases from the same MySQL >> 5 server - each using t

[RDBO] Two RDBO hierarchies interfering

2007-06-25 Thread Adrian Howard
Anybody encountered something like this? 1) I have a single process (mod_perl) with two different RDBO hierarchies connecting to two different databases from the same MySQL 5 server - each using their own IMA::DB subclasses 2) The two databases both have a table with the same name 3) This see

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 yo

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 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 >> 'Brighto

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

[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

Re: [RDBO] add_on_save expected/bug?

2007-06-07 Thread Adrian Howard
On 7 Jun 2007, at 16:10, John Siracusa wrote: > On 6/7/07 11:06 AM, Adrian Howard wrote: >> I had expected this: >> >>$o->add_foos( $foo1, $foo2 ); >> >> to be the same as: >> >>$o->add_foos( $foo1 ); >>$o->add_foos( $foo

[RDBO] add_on_save expected/bug?

2007-06-07 Thread Adrian Howard
Hi all, Just traced down some unexpected (to me anyway) behaviour. After reading the docs I'm not sure if it's my expectations or Rose::DB::Object that's confused. Basically I've got a one 2 many relationship, and am using add_on_save to add things. I had expected this: $o->add_foos( $

Re: [RDBO] Non sourceforge archive of list?

2007-06-05 Thread Adrian Howard
On 5 Jun 2007, at 14:50, John Siracusa wrote: > Yeah, I tend to use this one: > > http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/ Fantastic. Many thanks. Adrian - This SF.net email is sponsored by DB2 Exp

[RDBO] Non sourceforge archive of list?

2007-06-05 Thread Adrian Howard
Is there a non-sourceforge archive of this mailing list anywhere... sourceforge.net is giving me a 500 every time I try and get at things that look useful :-) Adrian - This SF.net email is sponsored by DB2 Express Downloa

Re: [RDBO] Streamlining documentation

2007-05-20 Thread Adrian Howard
On 20 May 2007, at 00:15, John Siracusa wrote: [snip] > The quick-start guide I envision has very little explanation, just > "here's a > database schema, here's how to wrap it with the loader and > manually, and > here's how to use the resulting classes to do stuff." It'd be for > people in

Re: [RDBO] Streamlining documentation

2007-05-19 Thread Adrian Howard
On 18 May 2007, at 21:41, Ask Bjørn Hansen wrote: [snip] > Since nobody else agreed with Marvin, I'd add my two cents that I do > think it'd be nice if the tutorial jumped "straight to the > meat" (says the vegetarian...). When I started looking at RDBO I at > least subconsciously found it intimi

Re: [RDBO] Scratchpad Space in RDBOs???

2007-04-20 Thread Adrian Howard
On 19 Apr 2007, at 20:31, John Siracusa wrote: [snip] > * Use an inside-out object approach. > > $My::Data{object_id($self)}{'whatever'} = ... [snip] I use Ovid's Class::BuildMethods for this. Lightweight and does the job. Adrian -

Re: [RDBO] Read-only objects

2007-04-04 Thread Adrian Howard
On 4 Apr 2007, at 17:21, John Siracusa wrote: [snip] > The only way to distinguish the two is by calling context. That > said, there > are (slightly) better ways to detect the context than using caller(). > Here's what I suggest: > > # Override init in you common base class > # (See the

Re: [RDBO] mod_perl / RDBO / segfault

2007-04-02 Thread Adrian Howard
On 2 Apr 2007, at 12:49, Adrian Howard wrote: > Don't consider this a bug report yet - since I'm still in the process > of narrowing this down and getting a small test case failing. [snip] Ignore me. Blame a dodgy DBD::mysql

[RDBO] mod_perl / RDBO / segfault

2007-04-02 Thread Adrian Howard
Don't consider this a bug report yet - since I'm still in the process of narrowing this down and getting a small test case failing. However, just in case it rings any "of course its Foo" bells I / appear/ to be seeing Rose::DB::Object::Loader::make_classes causing a segfault when running und

Re: [RDBO] Rose::DB::Loader (aka feeling dim)

2007-03-28 Thread Adrian Howard
On 28 Mar 2007, at 15:12, John Siracusa wrote: > On 3/28/07, Adrian Howard <[EMAIL PROTECTED]> wrote: >> CREATE TABLE products ( >> id SERIAL NOT NULL PRIMARY KEY, >> nameVARCHAR(255) NOT NULL, >> vendor_id INT REFERENCES

[RDBO] Rose::DB::Loader (aka feeling dim)

2007-03-28 Thread Adrian Howard
Okay. This is probably me being exceptionally stupid but with MySQL 5.0.22 (I know...) with this schema: DROP TABLE IF EXISTS vendors; CREATE TABLE vendors ( idSERIAL NOT NULL PRIMARY KEY, name VARCHAR(255) NOT NULL, UNIQUE(name) ) TYPE = InnoDB

Re: [RDBO] MySQL SET columns not checking values()?

2007-03-01 Thread Adrian Howard
On 1 Mar 2007, at 13:44, John Siracusa wrote: > On 3/1/07 7:03 AM, Adrian Howard wrote: >> I've got some SET columns which RDBO seems to be parsing fine, since >> the column() values() are set okay, but it accepts things that aren't >> in values(). Bug? Expected b

[RDBO] MySQL SET columns not checking values()?

2007-03-01 Thread Adrian Howard
I've got some SET columns which RDBO seems to be parsing fine, since the column() values() are set okay, but it accepts things that aren't in values(). Bug? Expected behaviour? Currently I'm wrapping my set columns with the moral equivalent of: sub some_column { my $self = shift; if

Re: [RDBO] safe namespace for user data in rose objects ?

2007-03-01 Thread Adrian Howard
On 1 Mar 2007, at 00:47, Jonathan Vanasco wrote: > would it be possible to reserve a namespace within rose db objects > for user use? [snip] Using one of the inside-out object classes is one way around this. I use Class::BuildMethods. Adrian --

Re: [RDBO] Sharing one database between all objects

2007-02-26 Thread Adrian Howard
On 26 Feb 2007, at 08:28, Jud wrote: > I'm not sure how to get Rose to use only a single database object > for all classes and objects. I am looking for a better way than to > create a new Rose::DB object at the beginning of every script, and > then pass it to each object as it gets created

Re: [RDBO] Customising R:D:O:Loader generated methods

2007-02-22 Thread Adrian Howard
On 21 Feb 2007, at 23:40, Ask Bjørn Hansen wrote: > > On Feb 21, 2007, at 3:10, Adrian Howard wrote: > >> Rose::DB::Object::Loader->new( >> db => MyApp::DB->new, >> class_prefix => 'MyApp' >> )->make_classes( &

Re: [RDBO] Customising R:D:O:Loader generated methods

2007-02-21 Thread Adrian Howard
On 21 Feb 2007, at 14:40, John Siracusa wrote: [snip] > That's reasonable. I've done similar things in generated and manually > created classes. [snip] Super :) > >> As I understand it triggers happen after the object is updated in >> memory. I >> want to shim stuff in before this (so I can

Re: [RDBO] Customising R:D:O:Loader generated methods

2007-02-21 Thread Adrian Howard
On 21 Feb 2007, at 13:51, Randal L. Schwartz wrote: >>>>>> "Adrian" == Adrian Howard <[EMAIL PROTECTED]> writes: > > Adrian> I've got a whole mess-o-tables that (by and large) > Adrian> Rose::DB::Object::Loader deals with splendidly. Howeve

[RDBO] Customising R:D:O:Loader generated methods

2007-02-21 Thread Adrian Howard
Hi, I'm moderately new to R:D:O - so I just want to sanity check that the following is reasonable / idiomatic. I've got a whole mess-o-tables that (by and large) Rose::DB::Object::Loader deals with splendidly. However, there are a few columns where I would like to do a little client-side st

Re: [RDBO] Setting mysql_enable_utf8 for Rose::DB::MySQL?

2007-01-24 Thread Adrian Howard
On 23 Jan 2007, at 18:32, John Siracusa wrote: > On 1/23/07, David Naughton <[EMAIL PROTECTED]> wrote: >> I prefer to set mysql_enable_utf8 in the connect options based on >> this >> from the DBD::mysql docs >> http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm>: >> >> "Additionally, turnin

Re: [RDBO] Setting mysql_enable_utf8 for Rose::DB::MySQL?

2007-01-23 Thread Adrian Howard
On 23 Jan 2007, at 16:00, David Naughton wrote: [snip] > The docs say that mysql_enable_utf8 is an "object method", and you're > calling it as a class method. D'oh! I missed the subheading. Obviously need more coffee :) > In order to enable utf8 for all > connections, try this: > > __PACKAGE__->

[RDBO] Setting mysql_enable_utf8 for Rose::DB::MySQL?

2007-01-23 Thread Adrian Howard
I want all of my MySQL database connections to have mysql_enable_utf8 set. From the docs I expected something like: package My::DB; use base qw( Rose::DB ); __PACKAGE__->use_private_registry; __PACKAGE__->register_db( domain => 'test', type => 'main', driver => 'mys