[Zope-dev] ZPatterns: persistant objects hold DataSkin-Items -> KeyError: _v_dm_
Ulrich Eck
ueck@net-labs.de
Tue, 12 Dec 2000 19:23:20 +0100
hi out there,
i use zpatterns/specialists for a Network-Documentation Tool.
I'm writing a Product which controls the relations between specialists
and manages multible actions (edit/new/delete) for ZPatterns DataSkinObjects
(DSO).
I have a Product-Instance of ZTWM (ZTransactionWorkflowManager) in my
application root which is a Folder by itself and holds as folder-objects its
'Transactions' (in this case a Transaction starts at the first edit-action
and lasts
til the last submit of a form with valid entries - e.g finish transaction.)
It behaves like a Wizard (PTK) with next/back/cancel/finish buttons and
reads
out the DataSkinPropertysheet for creating the edit/new forms on the fly.
One can also define relations between the specialists an they are used to
edit
Foreign Keys.
small painting here:
\application-root
--\<Person> (specialist for persons)
--\<Komponent> (specialist for komponents)
--\<ZTWM> (my TransactionWorkflowMangager - Folder)
---- \<1> (first transaction -Folder)
-------\<1> (first transaction object - Folder)
--------| ds_object (attribute which references the DSO)
--------| more info on the current Transaction object
-------\<2> (second Transaction object)
--------| ds_object (attribute which references the DSO)
--------| more info on the current Transaction object
----\<2> (second Transaction)
...
so far about how it should work ..
For each TransactionObject (TO) I save the Object I retrieved with
"specialist.getItem(id) == DataSkinObject(DSO)"
as attribute "ds_object" to the TransactionObject.
After I restarted Zope and want to replay/finish a transaction,
i get an KeyError, Value _v_dm_
the prefix _v_ stands for not pickeable (afaik)
dm for datamanager ?!?
ok .. i put a TO in the Transaction, get the actual DSO,
call the transactionmanagers editor function and a form with correct values
is displayed,
i can edit this form and call the DSO manage_changeProperties method from
the
transactionmanager.
when i don't finish a transaction and restart zope i still have my
transactions with proper
values saved in my TransactionManager - except the property "ds_object" wich
was assigned
to the DSO at TO-creation
when i try to set/get an attribute i get the KeyError of "_v_dm " ...
I can deal arround that if i reget the DSO from the specialist in every
function which deals with DSO's.
is there a better way to
a) tell my TransactionManager that my attribute "ds_object" is not pickeable
(e.g. call it _v_ds_object)
and how to know if zope is restarted ?!?!?
or
b) store this object persistantly in my TO without showing it in the
folder-structure but behave like a DSO
set/get attributes through Skinscripts
hope that i described clearly enough where my problem is ...
thanks for your reply
Ulrich Eck
net-labs