Hi,

  I have a structure as this:

  fossati 
          setup  (module with attribute USER)
          models/cliente    (User)
                 calendar   (Entry)
          apps/job

  in calendar.py:
  
  from cliente import User

  class Entry(Base):
        ...
        user = relation(User, secondary=calendar_entry_user, lazy=True)

  
  in apps.job I do something as:

  from fossati import setup
  from fossati.models.calendar import Entry
  
  user = session.merge(setup.USER, dont_load=True)
  e = Entry()
  e.user = [user]

  but when I session.commit() I get the following error, that I guess
  depends on the different way I can specify User as
  fossati.models.cliente.User or just models.cliente.User, but I can't
  understand how to fix it.

  The SA error is:
  
Attempting to flush an item of type <class 'models.cliente.User'> on
collection 'Entry.user', whose mapper does not inherit from that of <class
'fossati.models.cliente.User'>

   thanks
   sandro


-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy

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