You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just trying to get started using the sample code provided, but I'm getting this traceback:
$ python hello.py
Traceback (most recent call last):
File "hello.py", line 20, in <module>
sa.orm.configure_mappers()
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy/orm/mapper.py", line 2736, in configure_mappers
Mapper.dispatch._for_class(Mapper).after_configured()
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy/event/attr.py", line 218, in __call__
fn(*args, **kw)
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy/orm/events.py", line 550, in wrap
fn(*arg, **kw)
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy_continuum/builder.py", line 159, in configure_versioned_classes
self.build_transaction_class()
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy_continuum/builder.py", line 139, in build_transaction_class
self.manager.create_transaction_model()
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy_continuum/manager.py", line 155, in create_transaction_model
self.transaction_cls = self.transaction_cls(self)
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy_continuum/factory.py", line 11, in __call__
return self.create_class(manager)
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy_continuum/transaction.py", line 117, in create_class
TransactionBase
File "/home/mapleoin/sandbox/continuum/venv/lib/python2.7/site-packages/sqlalchemy_continuum/transaction.py", line 144, in Transaction
'relationship ' % (user_cls, user_cls)
sqlalchemy_continuum.exc.ImproperlyConfigured: Could not build relationship between Transaction and User. User was not found in declarative class registry. Either configure VersioningManager to use different user class or disable this relationship
# hello.py importsqlalchemyassafromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlalchemy_continuumimportmake_versionedBase=declarative_base()
make_versioned()
classArticle(Base):
__versioned__= {}
__tablename__='article'id=sa.Column(sa.Integer, primary_key=True, autoincrement=True)
name=sa.Column(sa.Unicode(255))
content=sa.Column(sa.UnicodeText)
# after you have defined all your models, call configure_mappers:sa.orm.configure_mappers()
As stated on kvesteri#101, quickstart example doesn't work as is. I've adapted the snippet to let it work without problem if someone copy and paste it.
tsantanaDH
added a commit
to tsantanaDH/sqlalchemy-continuum
that referenced
this issue
Mar 5, 2018
As stated on kvesteri#101, quickstart example doesn't work as is. I've adapted the snippet to let it work without problem if someone copy and paste it.
I'm just trying to get started using the sample code provided, but I'm getting this traceback:
The text was updated successfully, but these errors were encountered: