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::Helpers ?

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:

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 post one and describe how you'd like

[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

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 and

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)allow

[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 = 'London',

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] 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(

[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

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

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 a

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

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

[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 =

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 vendors (id), UNIQUE(name

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

[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

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. However, there are a Adrian few columns where I would like to do a little

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 preserve

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 URL:http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm: Additionally, turning on this

[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 = 'mysql',

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: