hi again i managed to trace the first problem (access denied) to SiteAccess. but i still can't get the answer for my 2nd Q. got traceback when i tried to add a zclass instance. here's the traceback Traceback (innermost last): File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/Zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: Artikel_add) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: Artikel_add) File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 150, in __call__ (Object: Artikel_add) File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: Artikel_add) File /usr/local/Zope/lib/python/DocumentTemplate/DT_With.py, line 133, in render (Object: Artikel.createInObjectManager(REQUEST['id'], REQUEST)) File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: Artikel.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 0, in ? File /usr/local/Zope/lib/python/ZClasses/ZClass.py, line 461, in createInObjectManager (Object: Artikel) AttributeError: _getOb all help appreciated. -- ------------------------------------------------------ http://www.kedai.com.my/kk Am I Evil?
I'm getting the same error on Zope 2.1.5. My zclass A which inherits object manager. Inside it I have zclass B. When I try to create B object inside A folder Zope gives me an Attribute Error: _getOb inside B.createInObjectManager () It seems then Zope does not see class A's parent object manager. But, I have exported A objects containing B object from 2.1.4 to 2.1.5 and that works. There are no problems on 2.1.4. Classes are first defined on 2.1.4 an then exported to 2.1.5. Zope is built from source on RH 6.0, python 1.5.2 Vladimir
Vladimir Petrovic wrote:
I'm getting the same error on Zope 2.1.5. My zclass A which inherits object manager. Inside it I have zclass B. When I try to create B object inside A folder Zope gives me an Attribute Error: _getOb inside B.createInObjectManager ()
That's very odd. I tried reproducing this and couldn't.
It seems then Zope does not see class A's parent object manager.
What do you mean by parent? Presumably, A subclasses ObjectManager. Right?
But, I have exported A objects containing B object from 2.1.4 to 2.1.5 and that works.
That's because export/import doesn't use createInObjectManager. I suggest one of the following: - Try a very simple example that you can deacribe completely so you can explain it to me in complete detail and I can try to reporiduce it. - If your database isn't too big (or if you can reproduce this with a small database) send me the database. I'll look at it and see if I can see what's going on. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Vladimir Petrovic wrote:
I'm getting the same error on Zope 2.1.5. My zclass A which inherits object manager. Inside it I have zclass B. When I try to create B object inside A folder Zope gives me an Attribute Error: _getOb inside B.createInObjectManager () It seems then Zope does not see class A's parent object manager. But, I have exported A objects containing B object from 2.1.4 to 2.1.5 and that works.
This is the second report of this bug but I cannot reproduce this, can you tell us _exactly_ how you get it to happen? -Michel
- wrote:
hi again i managed to trace the first problem (access denied) to SiteAccess.
Yup.
but i still can't get the answer for my 2nd Q. got traceback when i tried to add a zclass instance. here's the traceback
Traceback (innermost last): File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/Zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: Artikel_add) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: Artikel_add) File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 150, in __call__ (Object: Artikel_add) File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: Artikel_add) File /usr/local/Zope/lib/python/DocumentTemplate/DT_With.py, line 133, in render (Object: Artikel.createInObjectManager(REQUEST['id'], REQUEST)) File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: Artikel.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 0, in ? File /usr/local/Zope/lib/python/ZClasses/ZClass.py, line 461, in createInObjectManager (Object: Artikel) AttributeError: _getOb
I'm not seeing this. What are you trying to add the ZClass to? Zope 2.1.5 has a fix to ZClasses that makes it work correctly with ObjectManagers, including ObjectManagers that don't use instance attributes to hold sub-objects. All ObjectManagers should implement a method, _getOb, that is used to get an object from the object manager. If you are adding your instance to an object that is *not* an object manager, then the above error would be expected. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
(snip)
but i still can't get the answer for my 2nd Q. got traceback when i tried to add a zclass instance. here's the traceback
Traceback (innermost last): File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/Zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: Artikel_add) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: Artikel_add) File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 150, in __call__ (Object: Artikel_add) File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: Artikel_add) File /usr/local/Zope/lib/python/DocumentTemplate/DT_With.py, line 133, in render (Object: Artikel.createInObjectManager(REQUEST['id'], REQUEST)) File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: Artikel.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 0, in ? File /usr/local/Zope/lib/python/ZClasses/ZClass.py, line 461, in createInObjectManager (Object: Artikel) AttributeError: _getOb
I'm not seeing this. What are you trying to add the ZClass to? Zope 2.1.5 has a fix to ZClasses that makes it work correctly with ObjectManagers, including ObjectManagers that don't use instance attributes to hold sub-objects. All ObjectManagers should implement a method, _getOb, that is used to get an object from the object manager. If you are adding your instance to an object that is *not* an object manager, then the above error would be expected.
Please disregard this. I didn't perform the test correctly. I now can reproduce this. Stay tuned. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
- wrote:
hi again i managed to trace the first problem (access denied) to SiteAccess. but i still can't get the answer for my 2nd Q. got traceback when i tried to add a zclass instance. here's the traceback
(Snip.) This is due to a fix in Acquisition to a bug that obscured a bug in the handling of inner ZClasses. Sigh. We'll be putting ot a release to fix this. In the mean time, if you wish you can edit lib/python/App/Factory.py and change the line: _setObject=Acquisition.Acquired to: _setObject=_getOb=Acquisition.Acquired Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (4)
-
- -
Jim Fulton -
Michel Pelletier -
Vladimir Petrovic