Christian Klinger wrote:
> Hi,
>
> i try to alter Sequence after this Sequence is created. I guess the
> sqlalchemy event system is the place where i should look.
>
>
>
> I tried this one with no succes...
>
> from sqlalchemy import event
> from sqlalchemy import DDL
> from sqlalchemy import *
> from sqlalchemy.ext.declarative import declarative_base
>
> Base = declarative_base()
>
> seq = Sequence('some_table_seq', start=100, increment=1)
>
> class SomeClass(Base):
> __tablename__ = 'some_table'
> id = Column(Integer, seq, primary_key=True)
> zahl = Column(Integer)
>
> DSN = 'oracle://novareto:[email protected]/BGETest'
>
> engine = create_engine(DSN, echo=True)
> Base.metadata.create_all(engine)
>
>
> event.listen(SomeClass, "after_create", DDL('ALTER SEQUENCE
> some_table_seq NO_CACHE'))
SomeClass here is a mapped class, not a Table object. You're probably
looking for SomeClass.__table__.
>
>
> But this does not work. What should i add instead of SomeClass?
>
> Thanks in advance
> Christian
>
> --
> 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.
>
>
--
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.