Hello,
I got a weird error when I try to create a new object. Before It
worked without any problem, but I got this error after adding a new
attribute to the User class. This attribute is related to Screen in a
relation many to many through user_screens. This is the error:
"InvalidRequestError: One or more mappers failed to compile. Exception
was probably suppressed within a hasattr() call. Message was: One or
more mappers failed to compile. Exception was probably suppressed
within a hasattr() call. Message was: Class
'zeppelinlib.screen.ScreenTest.Screen' is not mapped"
These are the classes:
class Screen(rdb.Model):
"""Set up screens table in the database"""
rdb.metadata(metadata)
rdb.tablename("screens")
id = Column("id", Integer, primary_key=True)
title = Column("title", String(100))
ip = Column("ip", String(20))
...
user_screens = Table(
"user_screens",
metadata,
Column("user_id", Integer, ForeignKey("users.id")),
Column("screen_id", Integer, ForeignKey("screens.id"))
)
class User(rdb.Model):
"""Set up users table in the database"""
rdb.metadata(metadata)
rdb.tablename("users")
id = Column("id", Integer, primary_key=True)
name = Column("name", String(50))
...
group = relationship("UserGroup", uselist=False)
channels = relationship("Channel", secondary=user_channels,
order_by="Channel.titleView", backref="users")
mediaGroups = relationship("MediaGroup",
secondary=user_media_groups, order_by="MediaGroup.title",
backref="users")
screens = relationship("Screen", secondary=user_screens,
backref="users")
I might not added new relation to user because I really don't know
what the problem is...
Thanks in avance!
--
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.