It is done now. Thank you for all your help.
Suha

On Mon, Mar 30, 2009 at 17:06, Michael Bayer <[email protected]>wrote:

>
>
> On Mar 30, 2009, at 5:10 AM, Suha Onay wrote:
>
> > The problem is i defined the history class with the following way
> > (examining the test_versioning file):
> > ----------------------------------------------
> > Base = declarative_base(metaclass=VersionedMeta)
> >
> > class User(Base):
> >     __tablename__ = 'users'
> >
> >     id = sa.Column(sa.Integer, primary_key=True)
> >     name = sa.Column(sa.Unicode(12), info={'label': u'Kod Adı'})
> >     fullname = sa.Column(sa.Unicode(40), info={'label': u'Adı ve
> > Soyadı'})
> >
> > User_History = User.__history_mapper__.class_
> >
> > def upgrade():
> >     User.__table__.create(migrate_engine)
> >
> > def downgrade():
> >     User.__table__.drop(migrate_engine)
> > ----------------------------------------------
> > With the upper mode definition, when i updated a user data, it says
> > that no users_history table defined.
> >
> > If in upgrade, add the line
> > "User_History.__table__.create(migrate_engine)", it says that:
> > type object 'UserHistory' has no attribute '__table__'
> >
> > How can i define the models?
>
> im going to assume that "define the models" means "create the
> tables".  if so, just call Base.metadata.create_all().
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to