Re: Why are my col names lowercased?

[prev] [thread] [next] [Date index for 2004/10/13]

From: Daniel Wijnands
Subject: Re: Why are my col names lowercased?
Date: 19:29 on 13 Oct 2004
This does the trick : 

my $Object = YourObject->retrieve(id);
my %data = map { $_->name , $Object->get($_->name)} $Object->columns;

Kind regards daniel 

On Wed, 2004-10-13 at 20:56, Sean Quinlan wrote:
> The column names in my database contain capitol letters, generally the
> first letter. No, there is nothing requiring that - I just think they
> look better.
> 
> In an application I'm working on, I'm copying all the values for a
> particular objects attributes into an aggregate data structure, which
> will be used elsewhere to populate a form. Everything seemed to be
> working fine - but for some reason none of the values appeared in the
> form. Eventually I dumped the data structure, and discovered lower cased
> keys for the column names which had the expected values.
> 
> WTF!?!?!
> 
> My only guess is that for some reason someone thought it was desirable
> to have capitalization typos in accessing data be ignored, or something
> equivalent? Personally, I'd rather have my typo's cause warnings or
> errors. Whatever. Even so, WHY would you want to return lower cased
> versions of my column names?!? I expect to get back column names in
> _exactly_ the same format I defined my class with. Now I have hundreds
> of lines of code using data structures, forms, etc that use the column
> names as defined.
> 
> I really don't want to have to hand code the column names inside the
> app. Is there any way to get the column names back from the object as
> is?!?
> 
> Sorry for ranting, but this cost me some time, for something that seems
> to me very  unintuitive and annoying.
> 
> Thanks!!!

Why are my col names lowercased?
Sean Quinlan 18:56 on 13 Oct 2004

Re: Why are my col names lowercased?
Perrin Harkins 19:26 on 13 Oct 2004

Re: Why are my col names lowercased?
Sean Quinlan 21:08 on 13 Oct 2004

Re: Why are my col names lowercased?
Perrin Harkins 21:15 on 13 Oct 2004

Re: Why are my col names lowercased?
Daniel Wijnands 19:29 on 13 Oct 2004

Re: Why are my col names lowercased?
Sean Quinlan 21:07 on 13 Oct 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52