Re: inflating columns to objects
[prev]
[thread]
[next]
[Date index for 2004/10/27]
On Wed, 27 Oct 2004 15:33:45 +0100, Dave Howorth
<dhoworth@xxxxxxx.xxx.xx.xx> wrote:
> Drew Taylor wrote:
> > Ahhh... stringification. By default CDBI uses the primary key(s) when
> > stringified, but that is configurable.
> >
> > # the easy way
> > Widget->columns(Stringify => qw/your_col/);
> >
> > # the more powerful way
> > sub stringify_self {
> > my $self = shift;
> > return join ":", $self->id, $self->name;
> > }
>
> Well this is how to set up how a table reference is presented, and I do
> use that where appropriate, but that's not what we're talking about. The
> problem is getting my desired representation of a particular column on a
> particular page.
>
> To do get a particular representation of a column, I've overloaded the
> stringification operator with a method of your choice (display, in my
> case). See the code I posted for how to do it. That works on Maypole's
> list page but doesn't work when processed by AsForm for Maypole's edit page.
Oh, that's a bummer. Very strange how one page would get it right but
another does not. Sounds like there is some strong voodoo going on in
AsForm. Guess you'll need that debugger after all. Sorry I couldn't be
more help. :-(
Drew
--
----------------------------------------------------------------
Drew Taylor * Web development & consulting
Email: drew@xxxxxxxxxx.xxx * Site implementation & hosting
Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------
|
(message missing)
|