[Zope] Re: ZClasses and "title" property

2001-01-23 Thread Aaron Louie

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] Upgrade woes and product import problems

2001-01-18 Thread Aaron Louie

It worked like a charm! Thanks for the tip!

As you suggested, perhaps this sort of ZGlobals corruption checking should
be built into the core... I'd also like to see some automatic garbage
collection in the default stop script -- like removing the temporary data
and pid files. I've modified mine to do this.

Thanks again,
ajl

> This sounds like a bug that pre-dates 2.3 - have you tried
> using Shanes 'ZGlobals Repair' utility?
> 
> http://www.zope.org/Members/hathawsh/ZGlobalsRepair
> 
> If not, can you give it a shot and let me know if it fixes the
> problem? If so, I'm inclined to weave a version of Shane's
> workaround into the core for 2.3 to mitigate this sort of problem.
> 


___
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] Upgrade woes and product import problems

2001-01-18 Thread Aaron Louie

Well, I figured out a kludge from the "How to backup Zope data base?" thread
and from the rc shutdown script. Turns out I needed to remove the Data.fs.*,
pcgi.soc, and *.pid files -- leaving ONLY Data.fs and a few others, like the
FSSession directory.

That got both 2.2.5 and 2.3b1 to start up with my data. Only problem is that
all instances of the ZClass I had created in my product (which I named
ArticleProduct, btw) are broken in 2.3b1. The product itself appears in the
Product Management menu, but even instances of ZClasses within the product
are broken. Re-importing ArticleProduct.zexp does no good... I still get
that "append" AttributeError (see traceback below). Is this a bug w/ 2.3b1
or am I missing something?

Any help?
ajl


> I'm trying to upgrade to 2.3.0b1 from 2.2.5b1... I installed the new version
> (according to the ZopeInstall HowTo, just to be safe), which started fine. I
> then shutdown Zope (2.3.0b1), moved the default var/Data.fs* files to a
> backup directory, then copied my old Data.fs* files over. When I tried to
> re-start 2.3.0b1, nothing happened. No debug message either. So I put the
> default Data.fs* files back in and restarted successfully.
> 
> Fine, I thought, the database files aren't all that necessary. All the work
> I'd done on the previous version had been exported to a .zexp product export
> file, which were all subclassed from your run-of-the-mill ZClasses (image,
> file, folder, object manager, ZCatalog aware) and used DTML for all methods.
> No PythonMethods, no FSSessions, etc. So I put the .zexp file into the
> "import" folder and tried to import the product from within Zope. I got this
> error:
> 
> Error Type: AttributeError
> Error Value: append
> 
> Traceback (innermost last):
> File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 222, in
> publish_module
> File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 187, in
> publish
> File /usr/local/zope/2-3/lib/python/Zope/__init__.py, line 221, in
> zpublisher_exception_hook
> (Object: Traversable)
> File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 171, in
> publish
> File /usr/local/zope/2-3/lib/python/ZPublisher/mapply.py, line 160, in
> mapply
> (Object: manage_importObject)
> File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 112, in
> call_object
> (Object: manage_importObject)
> File /usr/local/zope/2-3/lib/python/OFS/ObjectManager.py, line 542, in
> manage_importObject
> (Object: Traversable)
> File /usr/local/zope/2-3/lib/python/ZODB/ExportImport.py, line 208, in
> importFile
> AttributeError: (see above)
> 
> Here's my questions:
> 1. Why are my old data files screwing up Zope 2.3.0b1?
> 2. Why can't I import my product?
> 
> Note: I also tried this with 2.2.5b1 --> 2.2.5, same errors.
> 
> Any insights? Thanks,
> ajl


___
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] Upgrade woes and product import problems

2001-01-17 Thread Aaron Louie

I'm trying to upgrade to 2.3.0b1 from 2.2.5b1... I installed the new version
(according to the ZopeInstall HowTo, just to be safe), which started fine. I
then shutdown Zope (2.3.0b1), moved the default var/Data.fs* files to a
backup directory, then copied my old Data.fs* files over. When I tried to
re-start 2.3.0b1, nothing happened. No debug message either. So I put the
default Data.fs* files back in and restarted successfully.

Fine, I thought, the database files aren't all that necessary. All the work
I'd done on the previous version had been exported to a .zexp product export
file, which were all subclassed from your run-of-the-mill ZClasses (image,
file, folder, object manager, ZCatalog aware) and used DTML for all methods.
No PythonMethods, no FSSessions, etc. So I put the .zexp file into the
"import" folder and tried to import the product from within Zope. I got this
error:

Error Type: AttributeError
Error Value: append

Traceback (innermost last):
  File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/local/zope/2-3/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/local/zope/2-3/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: manage_importObject)
  File /usr/local/zope/2-3/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: manage_importObject)
  File /usr/local/zope/2-3/lib/python/OFS/ObjectManager.py, line 542, in
manage_importObject
(Object: Traversable)
  File /usr/local/zope/2-3/lib/python/ZODB/ExportImport.py, line 208, in
importFile
AttributeError: (see above)

Here's my questions:
1. Why are my old data files screwing up Zope 2.3.0b1?
2. Why can't I import my product?

Note: I also tried this with 2.2.5b1 --> 2.2.5, same errors.

Any insights? Thanks,
ajl


___
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 )