|
|
caps & name fields / Jonah Crawford <jonah@newuses4.info>
caps & name fields
Jonah Crawford <jonah(at)newuses4.info> |
2005-10-17 12:58:40 |
[
FULL ]
|
DO I really need to do this kind of stuff to name fields to ensure
proper capitalization on display ?
def name(self):
buf0 = self.entrep_fname[0].upper()
buf1 = self.entrep_fname[1:].lower()
buf2 = ' '
buf3 = self.entrep_lname[0].upper()
buf4 = self.entrep_lname[1:].lower()
return buf0 + buf1 + buf2 + buf3 + buf4
|
Re: [ZPUGDC] caps & name fields / David Binger <dbinger@mems-exchange.org>
Re: [ZPUGDC] caps & name fields
David Binger <dbinger(at)mems-exchange.org> |
2005-10-17 13:04:14 |
[
FULL ]
|
On Oct 17, 2005, at 2:02 PM, Jonah Crawford wrote:
[...]
Would this work?
return self.entrep_fname.capitalize() + " " +
self.entrep_lname.capitalize()
|
Re: [ZPUGDC] caps & name fields / rjkimble@comcast.net
Re: [ZPUGDC] caps & name fields
rjkimble(at)comcast.net |
2005-10-17 13:17:25 |
[
FULL ]
|
You need to be a little careful when capitalizing names. You need to handle
names like DeLorme, de Mahy, van der Waals, McDonald, MacArthur, and so on.
Some people get mighty particular about capitalization!
One rule of thumb I use is to leave anything with mixed capitalization alone.
If the person who entered the data used mixed case to do so, there's probably a
good reason.
That's my $0.02 anyway.
[...]
|
Re: [ZPUGDC] caps & name fields / Jonah Crawford <jonah@newuses4.info>
Re: [ZPUGDC] caps & name fields
Jonah Crawford <jonah(at)newuses4.info> |
2005-10-17 13:31:35 |
[
FULL ]
|
That's a really good suggestion RJ - thanks! Also the capitalize
method works like a charm David. I'll have to test to determine if
caps are there and then pass if they are.
thnkz,
Jonah
Jonah Crawford
co-founder NewUses4.info
jonah(at)newuses4.info
202.487.9109
On Oct 17, 2005, at 2:21 PM, rjkimble(at)comcast.net wrote:
[...][...]
>>> DO I really need to do this kind of stuff to name fields to ensure
>>> proper capitalization on display ?
>>>
>>>
>>> def name(self):
>>> buf0 = self.entrep_fname[0].upper()
>>> buf1 = self.entrep_fname[1:].lower()
>>> buf2 = ' '
>>> buf3 = self.entrep_lname[0].upper()
>>> buf4 = self.entrep_lname[1:].lower()
>>> return buf0 + buf1 + buf2 + buf3 + buf4
>>>[...][...]
|
Re: [ZPUGDC] caps & name fields / joel@joelburton.com
Re: [ZPUGDC] caps & name fields
joel(at)joelburton.com |
2005-10-18 07:02:00 |
[
FULL ]
|
On Mon, Oct 17, 2005 at 02:02:52PM -0400, Jonah Crawford wrote:[...]
You've already gotten advice on how to use ''.capitalize, I know.
One small point: if this an Archetype object, you really don't want
to use "self.entrep_fname"--use "self.getEntrep_fname()" instead.
Both will work for now, but if you use the former, it will prevent
you from switching your storage from simple attribute storage to
one of the other storages that Archetypes can use, and that's not
good.
- j.
|
|