RE: [Zope] Re: ZClasses and "title" property
> I think the problem goes deeper than that. Zope 2.3x no longer allows the > setting or creation of any property called "title" for new > ZClasses. Period > (At least, not in the same way it used to). Try it for yourself. If you > follow the steps in the "ZClass Properties" How-to > (http://www.zope.org/Members/lstaffor/zProperties), you'll find that Zope > 2.3x gives a "The id 'title' is invalid--it is already in use" error when > you try to create a property called "title". > > > > Is this a bug or am I missing something? > > ajl Its a bug - this is fixed in CVS for 2.3 beta 3. Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: ZClasses and "title" property
I think the problem goes deeper than that. Zope 2.3x no longer allows the setting or creation of any property called "title" for new ZClasses. Period (At least, not in the same way it used to). Try it for yourself. If you follow the steps in the "ZClass Properties" How-to (http://www.zope.org/Members/lstaffor/zProperties), you'll find that Zope 2.3x gives a "The id 'title' is invalid--it is already in use" error when you try to create a property called "title". Fine, you say, it's already there by default, right? Finish out the How-To, setting all the proper permissions, modifying the addForm and the constructor to accomodate your other properties. Then try creating an instance of your new class and setting the 'title' property through the addForm. The title will not be set when you hit 'Add'. The field will remain empty... Of course, the How-To above worked just fine in 2.2.5. Doesn't work anymore. There is no longer any default place to set the title in a new ZClass and the title property cannot be set thru DTML. (Haven't tried it in Python yet) Is this a bug or am I missing something? ajl >> 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 >) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: ZClasses and "title" property
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 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] 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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf > Of Tim Moore > Sent: Friday, January 19, 2001 14:59 > To: [EMAIL PROTECTED] > 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 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )