[RDBO] Integration with Rose::HTML::Form

2007-01-30 Thread Derek Watson
Hello, I am using RDBO in conjunction with Rose::HTML::Form for the first time, and wonder if there are any guides or examples out there showing some conventional integration techniques. Specifically, how best to use RHF's objects returned by object_from_form() style methods to update database

[RDBO] Rose::HTML::Form-validate()

2007-01-31 Thread Derek Watson
I see that as of 0.546, form validate() calls get passed to sub-forms by default, * Added a cascade parameter to validate(), which defaults to true. (Suggested by Guillermo Roditi) Which is great - exactly what I needed! But there is an order-of-operations problem for me, because

[RDBO] Deleting from a one-to-many

2007-02-06 Thread Derek Watson
Hello, What is the recommended idiom for deleting a single object from a one-to-many relationship? Using the textbook example, $p = Product-new(name = 'Kite'); $p-prices({ price = 1.23, region = 'US' }, { price = 4.56, region = 'UK' }); $p-save; # database is modified here How would

Re: [RDBO] Deleting from a one-to-many

2007-02-06 Thread Derek Watson
I agree that performing a group of actions in a single transaction is one of the prettiest features of RDBO, and I also like John's approach to making these shortcuts to Manager routines. I find myself constantly re-writing my table relationships for manager calls. On 2/6/07, Ask Bjørn Hansen

[RDBO] Sequence Support

2007-03-20 Thread Derek Watson
Hello, Is it possible to get sequence support in RDBO? I know that sequences are supported for primary key generation, but I have a few cases where they are used for non-keyed columns, and I find myself writing (and re-writing) this into my classes: sub insert { my $self = shift; unless

Re: [RDBO] map_records when I don't want 'em

2007-04-11 Thread Derek Watson
No, the Manager does no caching. Given the code you posted, I can't see a way that this could ever happen. Map records only (optionally, and not by default) appear when you're asking for a many-to-many relationship in your Manager call using the with_objects or require_objects parameters.

Re: [RDBO] map_records when I don't want 'em

2007-04-11 Thread Derek Watson
. Do I have to do this after the save()? Seems trivial in the above example but these operations happen in completely separate areas in my code. Cheers, Derek On 4/11/07, John Siracusa [EMAIL PROTECTED] wrote: On 4/11/07, Derek Watson [EMAIL PROTECTED] wrote: items = { type

Re: [RDBO] Delays

2007-04-27 Thread Derek Watson
Congrats! On 4/27/07, John Siracusa [EMAIL PROTECTED] wrote: Sorry for any delays in responding to RDBO issues or email. We just had a baby (our second) and things will likely be a bit hectic here for a while... :) -John

Re: [RDBO] Delays

2007-04-27 Thread Derek Watson
And you finally settled on Postgresquella? On 4/27/07, John Siracusa [EMAIL PROTECTED] wrote: Thanks to all. Incidentally, Rose was one of my name choices for her, but my wife nixed it :) -John - This SF.net email is

Re: [RDBO] Release soon

2007-05-01 Thread Derek Watson
I feel like I'm repeating work here -- I've got a similar set of functions that serialize and restore trees of objects, only I'm doing this in a very specific way, keeping only what I want from specific classes (not reusable). What are the chances of this object_tree code making it into 0.764 or

Re: [RDBO] Short cut for setting map records data

2007-05-17 Thread Derek Watson
I have gone down a similar path before, http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg01792.html The short story is that a map_record is not designed to be manipulated, it's only there for convenience when fetching related objects from a many-to-many relationship call, such

Re: [RDBO] Streamlining documentation

2007-05-18 Thread Derek Watson
It's on the list, but not at the top just yet. (Even just collecting and editing recipes takes time.) If someone else wants to head this up, let me know. Is there a Wiki installed somewhere we can start working on in an ad-hoc fashion?

Re: [RDBO] One-to-One on unique key

2007-05-18 Thread Derek Watson
. If you set $a-b({ name = 'test' }), will Rose know to map the b back to the a as well as mapping the a to the b? Which is a cleaner approach? On 5/18/07, John Siracusa [EMAIL PROTECTED] wrote: On 5/18/07, Derek Watson [EMAIL PROTECTED] wrote: Am I modeling this wrong? How can I get Rose

[RDBO] MakeMethods::Generic.pm 'count' interface errors

2007-06-14 Thread Derek Watson
Hello, I am trying to move to related_count() method calls in my RDBO (0.764) app, they seem so convenient and quick. I am running into two separate bugs, however: 1. A fatal error is thrown when the object count is zero. I believe this is happening around line 2749 of MakeMethods::Generic:

Re: [RDBO] MakeMethods::Generic.pm 'count' interface errors

2007-06-18 Thread Derek Watson
Which dies because $count is assigned zero, making the statement evaluate false. Whoops, careless copy/paste. That's fixed in SVN now. Great, thanks very much! 2. If I am counting objects related by a many-to-many where the mapping table has a multi-valued primary key, the query

Re: [RDBO] MakeMethods::Generic.pm 'count' interface errors

2007-06-18 Thread Derek Watson
What you need is COUNT(DISTINCT some_function_that_joins_all_args(arg, arg)) because you really want 4,5 to be counted distinctly from 4,6. So coalesce definitely doesn't do it. Right, It seems like a simple concat (pg operator ||) would work in this case: SELECT COUNT(t1.a_id ||

Re: [RDBO] MakeMethods::Generic.pm 'count' interface errors

2007-06-18 Thread Derek Watson
It seems like a simple concat (pg operator ||) would work in this case: SELECT COUNT(t1.a_id || t1.b_id) Ugh, I forgot the DISTINCT again: SELECT COUNT(DISTINCT t1.a_id || t1.b_id) But this is tested and works properly too.

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

2007-07-04 Thread Derek Watson
Thanks for this! On 7/4/07, John Siracusa [EMAIL PROTECTED] wrote: On 6/11/07, Derek Watson [EMAIL PROTECTED] wrote: 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

[RDBO] Boolean cannot set NULL

2007-07-05 Thread Derek Watson
Is there a way to set a RDBO boolean column to NULL? It seems to me that undef evaluates to FALSE. $obj-bool_column(undef); $obj-save; print $obj-bool_column; # 0 Should I be creating my own column class for this? - This

Re: [RDBO] Still fighting with transactions

2007-08-17 Thread Derek Watson
I just meant that it'd be a change in historic behavior that could break some people's code when they upgrade (not that RDBO is 1.0 yet, but it's still nice to avoid this kind of thing, if possible). This is off-topic, but what lies ahead on the road between RDBO 0.7xx and 1.0? Are there

[RDBO] Rose::DB array column bug

2007-12-13 Thread Derek Watson
Is there a reason why I can't set the first value of an array to NULL? I want to store this {NULL, 1, 2, 3} by way of an RDBO array column but I think the following function from Rose::DB 0.737 is preventing me from doing so: sub format_array { my($self) = shift; my @array = (ref $_[0]) ?

Re: [RDBO] Rose::DB array column bug

2007-12-13 Thread Derek Watson
That's ok, if you could just issue another release on CPAN just for this bug that would be great :P Thanks John! On 12/13/07, John Siracusa [EMAIL PROTECTED] wrote: On Dec 13, 2007 11:58 AM, Derek Watson [EMAIL PROTECTED] wrote: Is there a reason why I can't set the first value of an array

Re: [RDBO] Migrating the wiki to Google Code

2008-02-23 Thread Derek Watson
-- __ WaySpa.com - The World's Premier Spa Booking Agency Derek Watson, C.T.O. 298 Campbell Ave Web:www.WaySpa.com Ph: 416.482.9033 x 22 Fax:416.981.3109 Sales/Customer Care/Concierge --- 1-800-929-7723 [EMAIL PROTECTED] WaySpa.com