Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: type object 'Temporal' has no attribute 'activity_class' #56

Open
kootenpv opened this issue Nov 5, 2018 · 0 comments

Comments

@kootenpv
Copy link

kootenpv commented Nov 5, 2018

I tried both purely the example from the docs, and this example which I would imagine should just work.

Any idea what could be wrong?

import sqlalchemy as sa
import sqlalchemy.orm as orm
import temporal_sqlalchemy as temporal
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base

sessionmaker = orm.sessionmaker()
session = sessionmaker()
temporal.temporal_session(session)

# postgres 11 from docker
connection_string = "postgresql://postgres:[email protected]:5432/test"
engine = create_engine(connection_string, echo=True)

Base = declarative_base()

class MyModel(Base, temporal.TemporalModel):
    __tablename__ = 'my_model_table'
    __table_args__ = {'schema': 'my_schema'}

    id = sa.Column(sa.BigInteger, primary_key=True)
    description = sa.Column(sa.Text)

    class Temporal:
        track = ('description', )

# It crashes here with
# AttributeError: type object 'Temporal' has no attribute 'activity_class'

Base.metadata.create_all(engine)

m = MyModel()
session.add(m)
session.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant