On Friday 22 May 2009 08.43:09 Alexandre Conrad wrote: > Don't you want that non-null column to be a foreign key ?
Would that make a difference? cheers -- vbi > > 2009/5/21 Adrian von Bidder <avbid...@fortytwo.ch>: > > Hi, > > > > Is it possible to fetch the values of an autoincrement field without > > flushing the object to the DB? > > > > (In postgres, I obviously can manually fetch nextval of the > > automatically generated sequence, but I lose the portability that way > > ...) > > > > Why? > > > > Because I need the id to generate data that will be filled into some > > (non- null) columns of the table row. So I can't flush since I'll get > > an IntegrityError about non-null columns, and I can't fill those > > columns without knowing the id that's going to be assigned. > > > > (Yes, I can use dummy values, then flush(), and then update the row > > before committing. But that's not exactly elegant...) > > > > cheers > > -- vbi > > > > -- > > Fnord. > > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- -- Der Glaube versetzt Berge, der Zweifel erklettert sie. -- Friedrich Georg Jünger
signature.asc
Description: This is a digitally signed message part.