I can confirm this is a bug as I've found precedent for this not having to
raise, new issue is
https://github.com/sqlalchemy/sqlalchemy/issues/4997
On Fri, Nov 22, 2019, at 9:24 AM, Mike Bayer wrote:
> that said, I'm looking at this as a potential bug because it should be able
> to leave this
that said, I'm looking at this as a potential bug because it should be able to
leave this attribute alone, not really sure how this should be handled.
On Fri, Nov 22, 2019, at 9:21 AM, Mike Bayer wrote:
> lazy="raise" on a many to one is problematic because a lot of many-to-one
> operations
lazy="raise" on a many to one is problematic because a lot of many-to-one
operations involve pulling up the object from the identity map, and that's it.
since people are usually only trying to guard against SQL being emitted, use
the raise_on_sql option instead:
parent = relationship(Parent,
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)