> -----Original Message----- > From: sqlalchemy@googlegroups.com > [mailto:sqlalch...@googlegroups.com] On Behalf Of jose soares > Sent: 16 April 2010 11:03 > To: sqlalchemy@googlegroups.com > Subject: Re: [sqlalchemy] cls._state / > cls._state.get('original') <class > 'sqlalchemy.orm.attributes.CommittedState'> > > jo wrote: > > Hi all, > > > > I cannot find anymore the attribute _state : > > > > if (not cls._state or not cls._state.get('original') or > > (cls._state['original'].data.get(k) != data.get(k)))): > > > > Could someone please help me? > > thank you > > > > j > > > To explain better my problem, in version 0.3 my models have the > attribute _state where I find the > <class 'sqlalchemy.orm.attributes.CommittedState'> > > (Pdb) self._state > {'original': CommittedState: {'anagrafica_dato_fiscale': > u'02241850367/02241850367', 'anagrafica_id_operatore': 1, > 'anagrafica_cap': None, 'anagrafica_telefono': None, > 'anagrafica_email': > None, 'anagrafica_nome': u'AZ.USL MODENA distr. PAVULLO', > 'anagrafica_cod_nazione_nascita': None, 'anagrafica_localita': None, > 'anagrafica_tipo': u'S', 'anagrafica_cod_cittadinanza': None, > 'anagrafica_tipo_persona': u'S', 'anagrafica_ts_ultima_modifica': > datetime.datetime(2010, 3, 3, 16, 4, 22, 50891, > tzinfo=<psycopg2.tz.FixedOffsetTimezone object at 0xc13488c>), > 'anagrafica_id': 8, 'anagrafica_data_nascita': None, > 'anagrafica_id_comune_nascita': None, 'anagrafica_id_comune': 15090, > 'anagrafica_cod_professione': None, 'anagrafica_indirizzo': u'?????', > 'anagrafica_cod_titolo_studio': None}, 'modified': False} > > I can't find this attribute anymore on version 0.6 > > j >
I haven't used this, so I don't know if this helps, but you may be interested in a couple of the functions described at http://www.sqlalchemy.org/docs/reference/orm/mapping.html#attribute-util ities In particular, either the instance_state() function or the get_history() function might be useful. I'm not sure there's much documentation for either the History class or the InstanceState class so you'll have to read the code in sqlalchemy.orm.state and sqlalchemy.orm.attributes Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.