Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Ron Savage
On 10 Jul 2006 18:08:31 -0700, Randal L. Schwartz wrote: Hi Randal > I can't use that just because of the logo. I'll admit it's a petty > complaint, but there it is. :) Not just that, but to install the whole thing under Windows requires wizards, elves and fairies, since for us humans that pain

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Cees Hek
On 7/10/06, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: > > On Jul 10, 2006, at 11:05 AM, John Siracusa wrote: > > > I have similar questions for as_json(). How should this work? > > Like you described (IMO). > > The more complicated schemes have their place, but for 80% (98%?) of > the applicatio

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Ask Bjørn Hansen
On Jul 10, 2006, at 11:05 AM, John Siracusa wrote: > I have similar questions for as_json(). How should this work? Like you described (IMO). The more complicated schemes have their place, but for 80% (98%?) of the applications a simple hash would be much easier to deal with. - ask -- h

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Jonathan Vanasco
On Jul 10, 2006, at 9:08 PM, Randal L. Schwartz wrote: > I can't use that just because of the logo. I'll admit it's a > petty complaint, but there it is. :) how odd. ever since i saw the logo, i've been wishing for a reason to use the package. i voted tooo many times for it in some 'best op

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Randal L. Schwartz
> "Jonathan" == Jonathan Vanasco <[EMAIL PROTECTED]> writes: Jonathan> SQLfairy ( perl ) does DB-> xml / yaml I can't use that just because of the logo. I'll admit it's a petty complaint, but there it is. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 ht

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Ron Savage
On Mon, 10 Jul 2006 14:05:53 -0400, John Siracusa wrote: Hi John >> I'm actually planning to add as_json() and as_yaml() Helper >> methods for RDBO eventually... Are you subscribed to the Module::Build mailing list? Usage of YAML has been discussed there recently, and they now ship Module::Buil

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Jonathan Vanasco
you know, i should have mentioned this earlier.. don't know why i didn't think of it SQLfairy ( perl ) does DB-> xml / yaml last i touched it, there was some stuff going on with python's sqlalchemy related to yaml as well the sqlfairy stuff is probably more applicable, though its less about

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Ted Zlatanov
On 10 Jul 2006, [EMAIL PROTECTED] wrote: > Hm, seems like people have different goals here. My goal was simply > to be able to round-trip from Perl to YAML/JSON and then back to > Perl. Ah, I understand. A simple hash makes more sense in that case, the way you had it originally. Ted

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread John Siracusa
On 7/10/06, Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > On Jul 10, 2006, at 2:20 PM, Clayton Scott wrote: >> meta : >> class : My::Object >> columns : >> a: 1 >> b : 2 >> c : 3 > > personally, id rather see this: > > meta_rosedb: > class : My::Object > api: 0.73

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Ted Zlatanov
On 10 Jul 2006, [EMAIL PROTECTED] wrote: > Any ideas on the format for these? For example, I've got a > column_values_as_yaml() helper method like this: > > $o = My::Object->new(a => 1, b => 2, c => 3); > > print $o->column_values_as_yaml; > > which prints: > > a: 1 > b: 2 > c: 3 > > But then wha

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Jonathan Vanasco
On Jul 10, 2006, at 2:20 PM, Clayton Scott wrote: > meta : > class : My::Object > columns : > a: 1 > b : 2 > c : 3 personally, id rather see this: meta_rosedb: class : My::Object api: 0.73 columns: a: 1 b: 2 c: 3 just because, if this is g

Re: [RDBO] YAML and JSON helpers

2006-07-10 Thread Clayton Scott
On 7/10/06, John Siracusa <[EMAIL PROTECTED]> wrote: > Any ideas on the format for these? For example, I've got a > column_values_as_yaml() helper method like this: [ snip ] > But then what should the as_yaml() helper do? The same thing? Or > should the class name be in there somewhere? > >

[RDBO] YAML and JSON helpers

2006-07-10 Thread John Siracusa
On 6/30/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 6/30/06 5:33 PM, Jonathan Vanasco wrote: >> it'd be best not to have the rdb-object in a session anyways. i try to keep >> session data into a structure that has pure data and can serialize into >> json/yaml, as i often need to share betwee

Re: [RDBO] saving results into a session?

2006-07-10 Thread Ted Zlatanov
On 30 Jun 2006, [EMAIL PROTECTED] wrote: On 6/30/06 5:33 PM, Jonathan Vanasco wrote: >> it'd be best not to have the rdb-object in a session anyways. i try >> to keep session data into a structure that has pure data and can >> serialize into json/yaml, as i often need to share between mod_perl >>

Re: [RDBO] Renaming relationships

2006-07-10 Thread John Siracusa
On 7/10/06, Svilen Ivanov <[EMAIL PROTECTED]> wrote: > I'm trying to rename auto generated relationship to a more convenient > name. Before I continue with my other suggestions, remember that you can do this by making your own custom ConventionManager subclass so that the auto-generated names suit

Re: [RDBO] Postgres reserved words (was: Postgres and bytea columns)

2006-07-10 Thread John Siracusa
On 7/10/06, Danial Pearce <[EMAIL PROTECTED]> wrote: >>> OT: Probably worth a different thread, but anywho. I had troubles with a >>> column name of "cast" that was quoted properly in my schema, but RDBO was >>> not quoting it correctly and throwing SQL errors everywhere. Is there some >>> hook whe

Re: [RDBO] Extending auto-generated methods

2006-07-10 Thread Svilen Ivanov
2006/7/10, Danial Pearce <[EMAIL PROTECTED]>: [...] > I've implemented this by telling RDBO to give my DB accessor/mutator > a different name. Yes - this definitely solves the problem. I've seen similar approach overriding Class::Accessor-generated methods - there are foo() and _foo_accessor() met

Re: [RDBO] Extending auto-generated methods

2006-07-10 Thread Danial Pearce
> I'm trying to alter the behaviour of specific auto-generated RDBO > method. For example I have Product and I want to make the `photo' > method to store the passed file name on file system. I've implemented this by telling RDBO to give my DB accessor/mutator a different name. __PACKAGE__->meta

[RDBO] Renaming relationships

2006-07-10 Thread Svilen Ivanov
Hi, I'm trying to rename auto generated relationship to a more convenient name. I checked the docs and the following (rather clumsy) code was expected to do the job: package My::Category; use base 'My::Object'; __PACKAGE__->meta->table('categories'); __PACKAGE__->meta->auto_initialize; # get t