Hi, 

I need to get a single event at an extension in case of such operation:

obj.colAttr = [x, y, z]

right now I will receive:
extension.remove(...) for each value currently in colAttr
extension.append(...) for x, y and z.

what I need is something like:

extension.replace(oldvalues, values) with two lists or something like
that.

Right now my approach (yes, I know this is sick) is:

def weComeFrom():
    f=inspect.currentframe().f_back.f_back
    while(inspect.getmodule(f).__name__.startswith('sqlalchemy.')):
        f=f.f_back
    return (f.f_lasti, f.f_code)
    

class ImmutableExtension(TefAttributeExtension):
    active_history = True
    triggerName = 'immutable'
    
    def append(self, state, value, initiator):
        f = weComeFrom()
        try:
            lf = initiator.__tefLastComeFrom
        except AttributeError:
            lf = None
        if len(self._getOldValue(state, initiator)) == 0:
            initiator.__tefLastComeFrom = f
            return value
        elif f == lf:
            return value
        else:
            self.raiseError(state, value, None, initiator)

What is the proper way to achieve this?

regards,
Filip Zyzniewski


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to