It's the usual missing "setup_all()" call. I guess I should really
work with the SQLAlchemy folks to make autosetup work again reliably.


On Wed, Jun 25, 2008 at 2:45 AM, lilo <[EMAIL PROTECTED]> wrote:
>
> I have another issue when I create file to load data into the tables.
> Error I am getting is:
>
> $ python d.py
> Traceback (most recent call last):
>  File "d.py", line 31, in <module>
>    load_data()
>  File "d.py", line 23, in load_data
>    sess1.save(m1)
>  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/
> sqlalchemy/orm/session.py", line 916, in save
>    self._cascade_save_or_update(instance)
>  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/
> sqlalchemy/orm/session.py", line 945, in _cascade_save_or_update
>    for obj, mapper in _cascade_iterator('save-update', instance,
> halt_on=lambda c:c in self):
>  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/
> sqlalchemy/orm/session.py", line 1237, in _cascade_iterator
>    mapper = _object_mapper(instance)
>  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/
> sqlalchemy/orm/util.py", line 371, in object_mapper
>    raise exceptions.InvalidRequestError("Class '%s' entity name '%s'
> has no mapper associated with it" % (object.__class__.__name__,
> getattr(object, '_entity_name', entity_name)))
> sqlalchemy.exceptions.InvalidRequestError: Class 'Engine' entity name
> 'None' has no mapper associated with it
>
> ==========================================
> d.py file:
>
> #!/usr/bin/env python
>
>
> import datetime, os
> from sqlalchemy import *
> from sqlalchemy import exceptions, sql
> from sqlalchemy.orm import *
> from sqlalchemy.orm.shard import ShardedSession
> from sqlalchemy.sql import operators
> from elixir import *
> from sqlalchemy.orm import create_session
>
> from c import m1,m2,n1,n2
> from a import A
> from b import B
>
> def load_data():
>
>    dm1 = A(aname="a")
>    dm2 = B(bname="b")
>    sess1 = create_session(bind=m1)
>    sess2 = create_session(bind=m2)
>    sess1.save(m1)
>    sess2.save(m2)
>    sess1.commit()
>    sess1.clear()
>    sess2.commit()
>    sess2.clear()
>
> if __name__ == '__main__':
>    load_data()
>
> >
>



-- 
Gaƫtan de Menten
http://openhex.org

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

Reply via email to