views:

87

answers:

2

My sqlalchemy is 0.6.3, and elixir is 0.7.1

I created a model class which extends Entity:

from elixir import *
class User(Entity):
    pass

And save the a user as:

user = User()
user.save()

It reports Session has no attribute 'save'

I looked into the code of elixir, found it invokes sqlalchemy.org.session.Session#save(), but there is no save() method there.

So, is elixir outdated, and we should not use it any more?

+1  A: 

I am using the same versions of SQLAlchemy and Elixir so it is definitely compatible. Not sure what you are trying to do with the above code.

Amit
How do you save an entity? `entity.save()` will throw exception, and `session.add(entity)` will also throw exception.
Freewind
A: 

Remember to call setup_all(True) before doing anything with session or query. This will do the necessary ORM mappings for the session and the query to work properly.

ychaouche