On Dec 10, 2007, at 4:53 PM, Adam Batkin wrote:

>
> My mental model has always been that once you save() something, it  
> will
> be at _least_ Pending, but might transition at any moment to  
> Persistent.
> This is only important because in my opinion, once you save() an
> instance, if you then poke at it's id attribute, you probably  
> shouldn't
> be disappointed if the id is suddenly not None (even though you never
> issued an explicit flush()). (for example if you issue a query that
> involves that table)

yeah SQLAlchemy started, like Rick was getting at, with a much "closer  
to the metal" idea than that, that if you made a new object and put it  
in the session, youd "know" that it wasnt flushed yet.  My experience  
with hibernate is identical, actually, nothing gets generated or  
anything in our environment over here until the flush happens.

But another thing, is that the whole idea of "save/update/save-or- 
update", which we obviously got from hibernate, is something ive been  
considering ditching, in favor of something more oriented towards a  
"container" like add().  since i think even hibernate's original idea  
of save/update has proven to be naive (for example, this is why they  
had to implement saveOrUpdate()).  we like to keep things explicit as  
much as possible since thats a central philosophical tenet of Python.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to