Re: [sqlalchemy] composite type nested

2018-12-12 Thread Tolstov Sergey
Thanks, Not so bad as expected) Can you add this example to official docs? среда, 12 декабря 2018 г., 20:33:05 UTC+3 пользователь Mike Bayer написал: > > composites of composites aren't supported directly so you'd have to > map out all the columns for "street" directly, then define a >

Re: many to many relation with foreign key to composite primary key

2018-12-12 Thread Mike Bayer
On Wed, Dec 12, 2018 at 1:01 PM patrick payet wrote: > > I had a SQLAlchemy model like - > > class User(DeclarativeBase): > __tablename__ = 'users' > > id = Column(BigInteger, primary_key=True) > email = Column(String(100), unique=True, nullable=False) > name =

Re: What would be the proper way to implement a post migration hook ?

2018-12-12 Thread Mike Bayer
On Wed, Dec 12, 2018 at 10:40 AM wrote: > > Dear Alembic User Community, > > I am looking for suggestion for the best way to address the following problem: > > We have a use case where we'd like to make sure some SQL queries are always > executed after any set migration. > Our particular use

many to many relation with foreign key to composite primary key

2018-12-12 Thread patrick payet
I had a SQLAlchemy model like - class User(DeclarativeBase): __tablename__ = 'users' id = Column(BigInteger, primary_key=True) email = Column(String(100), unique=True, nullable=False) name = Column(String(100), nullable=False) hashed_password = Column(String(100),

Re: [sqlalchemy] composite type nested

2018-12-12 Thread Mike Bayer
composites of composites aren't supported directly so you'd have to map out all the columns for "street" directly, then define a constructor that handles the columns: class Address(object): def __init__(self, name, value, towndetail): self.name = name self.value = value

What would be the proper way to implement a post migration hook ?

2018-12-12 Thread ncaniart
Dear Alembic User Community, I am looking for suggestion for the best way to address the following problem: We have a use case where we'd like to make sure some SQL queries are always executed after any set migration. Our particular use case is with PostgreSQL. We have several users who can

Re: [sqlalchemy] self-referential many-to-many relationship to retrieve peers with common left node

2018-12-12 Thread Kurt Forrester
Dear Mike, Thank you for the prompt response and concise changes. It now works perfectly for me. Hopefully somebody else will also find this useful. Kind regards, Kurt On Wednesday, December 12, 2018 at 2:21:21 AM UTC, Mike Bayer wrote: > > I can get a lazy load to do this: > > SELECT