Skip Menu |

This queue is for tickets about the Class-DBI-AsForm CPAN distribution.

Report information
The Basics
Id: 13594
Status: resolved
Priority: 0/
Queue: Class-DBI-AsForm

People
Owner: Nobody in particular
Requestors: arnaud [...] underlands.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Date: Fri, 8 Jul 2005 16:17:13 +0200
From: arnaud [...] underlands.org
To: bug-Class-DBI-AsForm [...] rt.cpan.org
Subject: Enhanced select
Hi, While working on Catalyst::Helper::Controller::Scaffold::HTML::Template I thought it would be nice if we could make nicer select displaying some other column in the options rather than the id (a label for example) I've browse through the documentation and didn't found an easy way to do it. So I took the liberty to modify Class::DBI::AsForm to add this feature. You'll find below, a patch. Hope you'll integrate it to your package. Any comments/questions are welcome. Arnaud ASSAD

Message body is not shown because sender requested not to inline it.

Date: Fri, 8 Jul 2005 19:20:08 +0100
From: Tony Bowden <tony [...] kasei.com>
To: ASSAD Arnaud via RT <bug-Class-DBI-AsForm [...] rt.cpan.org>
Subject: Re: [cpan #13594] Enhanced select
RT-Send-Cc:
On Fri, Jul 08, 2005 at 10:17:10AM -0400, ASSAD Arnaud via RT wrote: Show quoted text
> I thought it would be nice if we could make nicer select displaying > some other column in the options rather than the id (a label for example)
I'm not sure I follow this. Perhaps a test case would make it clearer? Tony
From: markstos [...] cpan.org
[tony@kasei.com - Fri Jul 8 14:48:23 2005]: Show quoted text
> On Fri, Jul 08, 2005 at 10:17:10AM -0400, ASSAD Arnaud via RT wrote:
> > I thought it would be nice if we could make nicer select displaying > > some other column in the options rather than the id (a label for
> example) > > I'm not sure I follow this. > > Perhaps a test case would make it clearer?
I believe the poster is seeing the primary ID column values, a bunch of integers, instead of the human friend label of that column. However, from my reading of the documentation, Class::DBI already has an elegant solution to this, which this module supports-- the ability to customize how a Class::DBI object is "stringified". It's explained more here: http://search.cpan.org/~tmtm/Class-DBI-0.96/lib/Class/DBI.pm#OVERLOADED_OPERATORS If I'm correct, this patch is not needed. Mark ( author of DBIx::AsForm, which does the same kind of thing without Class:DBI ).