On Apr 1, 2008, at 8:19 PM, johnnyice wrote:

>
> I got my web app migrated to pylons 0.9.6.1 and sqlalchemy 0.4.4 with
> the exception of a few calls.
>
> As I included the code example in my first post, for some reason the
> object does not want to obtain the id it was given when saved.
>
>            heading = Heading('Text')
>            heading.page = page_object
>            heading.user_id = '1'
>            meta.Session.save(heading)
>            meta.Session.commit()         # tried with and w/o this
> line
>
>            heading_id = heading.heading_id  # get new id...  *****
> why does this return None?
>
> the var heading_id still seems to have the value None.  I assume this
> has something to do with the autosave property.  I have that and
> transactional set to True.

if the session is flushing it, then the object definitely has its  
primary key attributes set.   you might want to check your mappings,  
"heading in meta.Session" to ensure its there, your SQL logs to ensure  
the flush is happening, etc.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to