[z3] trying sqlos on zope3 trunk
Adam Groszer
adamg at fw.hu
Sun Aug 21 09:55:04 CEST 2005
I'm trying to use sqlos with the current Zope3 trunk.
I'm trying to get the example working that is described in the
readme.txt. (I use the package "sot" instead of "myproject")
I had to do a small fix:
===================================================================
--- subscriber.py (revision 15900)
+++ subscriber.py (working copy)
@@ -23,9 +23,12 @@
# If we don't do this, the cache will be cleared
# and if we try to re-fetch the object we will
# lose the new values.
- obj.syncUpdate()
+ unproxied = removeSecurityProxy(obj)
+ #obj.syncUpdate()
+ unproxied.syncUpdate()
- expired(obj)
+ #expired(obj)
+ expired(unproxied)
sqlobjectCreatedSubscriber = sqlobjectModifiedSubscriber
to get it working.
After that the container and editform is working fine, but I cannot
add a new Person. There is no item to add on the left side.
If I try to
<browser:addform
schema="sot.interfaces.IPerson"
label="New Person"
name="AddPerson.html"
permission="zope.ManageContent"
>
</browser:addform>
<browser:addMenuItem
title="Person"
class="sot.app.Person"
permission="zope.ManageContent"
view="AddPerson.html"
/>
it fails even on diplaying the container itself, with:
...
File "f:\w\pyt\sqlos\container\__init__.py", line 150, in __len__
for k in self.keys(): i += 1
File "f:\w\pyt\sqlos\container\__init__.py", line 87, in keys
for name, obj in self.items(): yield name
File "f:\w\pyt\sqlos\container\__init__.py", line 104, in items
for obj in factory.select():
AttributeError: 'NoneType' object has no attribute 'select'
As I checked SQLObjectContainer.allowedFactories() returns also the
BrowserAdd__sot.app.Person factory. In turn factory =
getFactory(factoryName) fails as it returns None.
Please help, now I'm stuck
(Sorry for posting again)
--
Best regards,
Adam mailto:adamg at fw.hu
__________________________________________________________________
Nyaralás 50,000 Ft alatt: http://ad.advert.hu/url.php?u=226
Nyaralás Horvátországban: http://ad.advert.hu/url.php?u=227
További akciós utazási ajánlatok: http://utazas.swi.hu
More information about the z3
mailing list