=/
On Thursday, June 10, 2021 at 3:57:08 PM UTC+3 Mike Bayer wrote:
>
>
> On Wed, Jun 9, 2021, at 7:21 PM, Marat Sharafutdinov wrote:
>
> The problem is that currently only the entire codebase can be migrated
> from 1.3 to 1.4, even though it can be extremely difficult or too lo
t;.
>
> As you've probably seen, SQLAlchemy 1.4 /2.0 includes a very specific
> upgrade path with step-by-step instructions at
> https://docs.sqlalchemy.org/en/14/changelog/migration_20.html .
>
>
>
> On Wed, Jun 9, 2021, at 4:15 PM, Marat Sharafutdinov wrote:
>
> C
Currently I'm on SQLAlchemy 1.3 and there is a lot of work I have to do to
migrate to 1.4 / 2.0. I think it's good idea to distribute 1.4 / 2.0
versions not only as "SQLAlchemy" project but as additional separate
"SQLAlchemy2" project too with initial 1.4 version and then 2.0. This will
give
from sqlalchemy import Column, ForeignKey, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Parent(Base):
__tablename__ = 'parents'
id = Column(Integer, primary_key=True)
class
from sqlalchemy import Column, ForeignKey, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
from sqlalchemy import Column, ForeignKey, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
Base = declarative_base()
class Parent(Base):
__tablename__ = 'parents'
id = Column(Integer, primary_key=True)
from sqlalchemy import Column, ForeignKey, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import lazyload, relationship, sessionmaker
Base = declarative_base()
class Group(Base):
__tablename__ = 'groups'
id = Column(Integer,
ent, comment_read_query).subquery()
> news = session.query(News).outerjoin(comment_query).options(
> contains_eager(News.comments, alias=comment_query).with_expression(
> Comment.is_read, comment_query.c.is_read)
> ).all()
>
>
>
>
> On Fri, May 25, 2018 at 11:
The news has comments, the comments have readings by users.
I need to receive all the news with comments and readings of these comments
by a specific user.
The query is ok, but I can't get the value of the column `is_read` as an
attribute of the comment object.
--
SQLAlchemy -
The Python SQL
Here is the code:
from sqlalchemy import Column, ForeignKey, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
engine = create_engine('postgresql://postgres@localhost/test_db')
Session = sessionmaker(bind=engine)
10 matches
Mail list logo