]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
runtime annotation fixes for relationship
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 3 Jul 2022 20:25:15 +0000 (16:25 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Jul 2022 02:33:48 +0000 (22:33 -0400)
commit148711cb8515a19b6177dc07655cc6e652de0553
treeb75505c907d25395d77f45b94919b9a17e9432cf
parent4b3f204d07d53ae09b59ce8f33b534f26a605cd4
runtime annotation fixes for relationship

* derive uselist=False when fwd ref passed to relationship

  This case needs to work whether or not the class name
  is a forward ref.  we dont allow the colleciton to be a
  forward ref so this will work.

* fix issues with MappedCollection

  When using string annotations or __future__.annotations,
  we need to do more parsing in order to get the target
  collection properly

Change-Id: I9e5a1358b62d060a8815826f98190801a9cc0b68
lib/sqlalchemy/orm/__init__.py
lib/sqlalchemy/orm/clsregistry.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/util/typing.py
test/orm/declarative/test_dc_transforms.py
test/orm/declarative/test_tm_future_annotations.py
test/orm/declarative/test_typed_mapping.py
test/orm/test_deferred.py