Good evening everybody!
I have some question regarding attribute and agent programming for ZPatterns.
I have some provider which is registered for the "handlers" and "attributes"
methods and some attributes.
My problem is when trying to create a new object and directly editing it, e.g.
the propertysheet is defined and my provider is also registered for
handling the property "foobar". Unfortunately my SetAttributeFor() method
is never called.
Also defined in my provider are _objectAdded(), _objectAdding(), _objectChanged()
(but not _objectChanging()). Here's what they do:
_objectAdded() is storing the data collected via SetAttributeFor() into an sql
database as new record
_objectAdding() is doing the same as the original method but also committing the
as otherwise the new record will not be stored into the database
it calls _objectAdded() via the transaction mechanism). I needed to do
as otherwise a getattr on the primary key (==loadAttrib) failed as I
to retrieve the record inside the _AttributeFor() method.
_objectChanged() doing the same as objectAdded() but updating the sql database.
So what's happening is that _objectAdding() and _objectAdded() get called from the
call but _SetAttributeFor() is not called. When doing the manage_changeProperties()
a new method which is called manually (and does a getItem()) everything is fine.
I've also tried to do
but this also did not call _SetAttributeFor().
So does any ZPatterns wizard has any idea on what I might do wrong?
(I can also send someone the source code if this message seems too confusing ;-)
PS: What I am trying to create is an sql attribute provider for ZPatterns which
is some replacement for manually creating the zsql method and SkinScript methods.
Unfortunately it seems more difficult than I thought at first ;-)
communication & design [EMAIL PROTECTED]
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -