[sqlalchemy] Re: Database Referential Integrity Constraints Puzzle

2007-12-16 Thread jerryji
Thanks Alex! Jerry On Dec 16, 2:18 am, alex bodnaru [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi jerryji, this database is not normalized. you may consider switching to: things(thingid INTEGER, thing_weight etc.) and things_translations(thingid INTEGER,

[sqlalchemy] Re: Using ORM Object as an intermadiate holder

2007-12-16 Thread sdobrev
the expire() is requesting a reload. try moving that after the sending back stuff to user. Utku Altinkaya wrote: Hi, I am using SQLAlchemy on a web application, I have used a base class for ORM clases which provides soem web related things like validation and loading data from forms etc.

[sqlalchemy] Re: some error around trunk

2007-12-16 Thread Michael Bayer
On Dec 16, 2007, at 2:40 AM, [EMAIL PROTECTED] wrote: from sqlalchemy import * m= MetaData() trans =Table( 'trans', m, Column( 'date', Date), ) balance=Table( 'balance', m, Column( 'finaldate', Date), ) b = balance.alias('b') sprev = select( [ func.max( b.c.finaldate)],

[sqlalchemy] Re: some error around trunk

2007-12-16 Thread sdobrev
ok; see mapper.py line 1134, calling after_update with state instead of state.obj() Michael Bayer wrote: On Dec 16, 2007, at 2:40 AM, [EMAIL PROTECTED] wrote: from sqlalchemy import * m= MetaData() trans =Table( 'trans', m, Column( 'date', Date), ) balance=Table( 'balance', m,

[sqlalchemy] obtaining previous value in mapper.extension.after_*

2007-12-16 Thread sdobrev
i used to get the original (before change) value of some attribute via state.commited_state[key]... but seems now that dict is empty at the time when ext.after_* are called. any way to get that? storing copies at ext.before_* is not good alternative...

[sqlalchemy] Re: obtaining previous value in mapper.extension.after_*

2007-12-16 Thread sdobrev
[EMAIL PROTECTED] wrote: i used to get the original (before change) value of some attribute via state.commited_state[key]... but seems now that dict is empty at the time when ext.after_* are called. any way to get that? storing copies at ext.before_* is not good alternative... found some

[sqlalchemy] Re: obtaining previous value in mapper.extension.after_*

2007-12-16 Thread Michael Bayer
On Dec 16, 2007, at 2:33 PM, [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: i used to get the original (before change) value of some attribute via state.commited_state[key]... but seems now that dict is empty at the time when ext.after_* are called. any way to get that? storing

[sqlalchemy] Re: Using ORM Object as an intermadiate holder

2007-12-16 Thread Utku Altinkaya
On 16 Aralık, 17:46, [EMAIL PROTECTED] wrote: the expire() is requesting a reload. try moving that after the sending back stuff to user. The documents says it does not reload until it is accessed if the object is expired, I think what does the thing you have mantioned is the refresh method

[sqlalchemy] Re: Using ORM Object as an intermadiate holder

2007-12-16 Thread sdobrev
expiring the obj has the effect that any further access to the object will auto-refresh it. so if u expire(x) and then say x.a. x will be reloaded first then u get x.a Utku Altinkaya wrote: On 16 Aralık, 17:46, [EMAIL PROTECTED] wrote: the expire() is requesting a reload. try moving

[sqlalchemy] Re: Using ORM Object as an intermadiate holder

2007-12-16 Thread Michael Bayer
On Dec 15, 11:02 pm, Utku Altinkaya [EMAIL PROTECTED] wrote: I do not want to lose invalid values, becouse I want to send them to the user again, so while using object as intermediate holder I have to set attributes invalid values... So Autoflush = False, and if invalid values are existed

[sqlalchemy] Re: obtaining previous value in mapper.extension.after_*

2007-12-16 Thread sdobrev
and another issue around attribute.get_history... i have a descriptor that is autosetting some defaultvalue at first get. before r3935 it was ok; now the atribute is not updated anymore (in exact case, another object has to be inserted but it is not) as it seems that ScalarObjectAttributeImpl

[sqlalchemy] Re: obtaining previous value in mapper.extension.after_*

2007-12-16 Thread Michael Bayer
On Dec 16, 2007, at 3:16 PM, [EMAIL PROTECTED] wrote: not sure what the three get_history sublists are for... (added, unchanged, deleted) = attributes.get_history(myinstance._state, 'someattribute') three lists will never be None unless you call get_history() with passive=True and