i all my mapper i use this property frequently:
@property
def changed(self):
return self._state.get('modified')
but in some cases ( 1:n relation ) mapper this don't work:
In [1]: o =Operatore.select()[4]
In [2]: o._state.get('modified')
Out[2]: False
In [3]: o.groups[0].acl_cod_ruolo
Out[3]: u'VET'
In [4]: o.groups[0].acl_cod_ruolo = '123'
In [5]: o.groups[0].acl_cod_ruolo
Out[5]: '123'
In [6]: o.groups[0]._state.get('modified')
Out[6]: True
In [7]: o._state.get('modified')
Out[7]: False
Why the parent self._state['modified'] don't get the changes from childs
mappers sometimes?
i'm doing something wrong?
Glauco
--
+------------------------------------------------------------+
Glauco Uri - Programmatore
glauco(at)allevatori.com
Sfera Carta Software® [EMAIL PROTECTED]
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---