Ash wrote:
> OK, I'm confused. On creating a new object 'Note'   like "note = Note
> (key=value, ...)" I'm getting the below error from TG2. We're running
> is WSGI and have the "DeclarativeBase = declarative_base
> (mapper=DBSession.mapper)" option active in model/__init__.py.
>
> We also tried just using the query_property version and using
> DBSession.add() caused the same effect.
>
> Anyone got a suggestion?
>
> -------- Original Message --------
> InvalidRequestError: Object '<Note at 0xaedb9d6c>' is already attached
> to session '2934155212' (this is '2936125932')
>   
I used to see something like this all the time with SQLAlchemy 0.4,
where you could not "add" a record which had already been added, even if
implicitly (by having an object that referenced it) added to the
session.  That is, if you had added "a" and "a.b" was a record, then
add( a.b ) would fail telling you that a.b was already registered. 
Sorry, it's been a while since I saw it, so I can't be more precise.  I
believe SQLAlchemy 0.5 has fixed that little wart, as I can't recall
seeing the error in quite some time.

HTH,
Mike

-- 
________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to