Re: ZClasses and "title" property
I guessed it was something like this, so this leads me to two followup questions. 1) I'd be happy to use the built-in title property assuming that it won't cause some kind of problem. I just don't know how I can set that in instance objects since it doesn't appear on the property sheet. Can I modify the addForm and add methods for the class to set it there? Do I need to make a custom view? What approach do most people take in this situation, using the built-in title or choosing a different name for a title-like property? 2) The tutorial in the Zope Developer's Guide instructs you to add a "title" property to CDClass (http://www.zope.org/Documentation/Guides/ZDG-HTML/ZDG.6.2.4.html). I haven't actually run through the tutorial exactly, but I assume from my experience that this won't actually work. Maybe this part of the guide should be changed to reflect this (as well as other sections that also use "title" as an example property). Thanks for the responses! "Loren Stafford" <lstafford@morphics.com> writes:
"title" is a "reserved" property; i.e. most objects automatically get a title property when you create them, but you are trying to add another property with the same name. Either use the "built-in" title property or use a different id for your title.
-- Loren
-----Original Message----- From: tmoore@challah.msrl.com [mailto:tmoore@challah.msrl.com]On Behalf Of Tim Moore Sent: Friday, January 19, 2001 14:59 To: zope@zope.org Subject: [Zope] ZClasses and "title" property
Let me start by introducing myself...My name is Tim Moore and I'm new to the list and Zope in general. I'm still figuring out how everything works, so forgive me if I'm missing something basic here :-)
I'm creating several ZClasses for the site I'm working on. In one of them I'd like to have a property called "title", but when I try to add it, I get the following error:
Error Type: Bad Request Error Value: The id "title" is invalid--it is already in use.
I'm confused, because this seems to happen even when I make a bare-bones minimal class, but a few of the examples I've found on the web site have ZClasses with title properties.
I'm using version 2.3b1...is this a recent change in behavior or am I doing something wrong? If this is a change, does this mean I have to use a different property name, or is there some other way I can edit this title property?
-- Tim Moore
Tim Moore wrote:
I guessed it was something like this, so this leads me to two followup questions.
1) I'd be happy to use the built-in title property assuming that it won't cause some kind of problem. I just don't know how I can set that in instance objects since it doesn't appear on the property sheet. Can I modify the addForm and add methods for the class to set it there? Do I need to make a custom view? What approach do most people take in this situation, using the built-in title or choosing a different name for a title-like property?
I use Title (note the upper-casity), and then I add a Python Mehtod (or in 2.3 a Python Script) called 'title' that simply does: return self.Title (or in a P.S.: return context.Title should do it ) Bill Anderson
participants (2)
-
Bill Anderson -
Tim Moore