Re: finalizeATCTSchema, _at_rename_after_creation, and title

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
rowan <rowan@...> writes:

> 
> On Thu, 2005-11-17 at 13:54 +0000, rowan wrote:
> >   A couple questions, probably pretty simple too.
> 
>   Hmm, as soon as I send the question I seem to answer it myself...
> 
> >   I want the title of my archetype to have a different label and
> > description on its widget. What's the correct way of overriding this?
> 
>   I tried:
> 
>     schema['title'].widget.label = 'Organisation'
> 
>   in the class definition and that works. Is this the way I should be
> doing it?

Yes. However, you need to make sure you copied the schema... So, you probably
start with BaseSchema or e.g. ATDocument.schema; you need to do:

mySchema = BaseSchema.copy() + Schema (( .... ))
mySchema['title'].widget.label = 'Organization'

The reason is that if you don't do copy(), because python stores the items of
dicts and lists by reference, you'll end up modifying the original schema, and
hence probably the titles of other portal types as well.

> >   Also, I've popped finalizeATCTSchema(name_of_my_schema) in at the end
> > of my schema definition, but I always get this error:
> > ------
> > [cut for space]
> > ------
> 
>   This has fixed itself yet though. ;)

Has not, you mean?

The problem is that you're not using an ATContentType's schema as your base
schema. ATCT makes some assumption about what's in your schema, including a
relatedItems field, because that's the "plone standard", if you like. How to use
ATCT as your base (which is probably a good idea if you're making something
that's primarily first-order content, as opposed to components of a more custom
solution), look at http://plone.org/documentation/tutorial/richdocument.

Martin





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.