Personal tools
You are here: Home Lists ZPUG DC List Archives 2005 2005-10 the title must die... / Jonah Crawford <jonah@newuses4.info>
Navigation
Log in


Forgot your password?
New user?
Mailing Lists
You can read our ZPUGDC mailing list archives online.
You can subscribe to our mailing list:
Book Review

The Definitive Guide to Plone

Reviewer: joel
 

the title must die... / Jonah Crawford <jonah@newuses4.info>

the title must die...
Jonah Crawford <jonah(at)newuses4.info>
2005-10-17 13:46:05 [ FULL ]
I didn't ask for it - but nevertheless got it. I would prefer if the  
title were grabbed from the data upon input assuming either the  
concatenated name or company name. Any way to assign it to the input  
of another field and keep it hidden ?

Jonah


Jonah Crawford
co-founder NewUses4.info
jonah(at)newuses4.info
202.487.9109

Re: [ZPUGDC] the title must die... / joel@joelburton.com

Re: [ZPUGDC] the title must die...
joel(at)joelburton.com
2005-10-18 06:47:30 [ FULL ]
On Mon, Oct 17, 2005 at 02:50:21PM -0400, Jonah Crawford wrote:[...]

Look at the ComputedField; you probably want something like:

schema = ComputedField('title',
      expression='context.getCompanyTitle()',
      accessor='Title',
      ...
      )

def getCompanyTitle(self):
    # put whatever you want here to find the "right" title
    return self.getFname() + " " + self.getLname() 


Note the use of "accessor='Title'"--subtle but important;
if you don't have this, then Archetypes will use 'getTitle'
for the accessor, and the metadata API, for historical reasons,
requires Title.

- j.

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: