Skip to content

Commit

Permalink
Merge pull request #725 from danigm/sqlalchemy-2.0.22
Browse files Browse the repository at this point in the history
Update GenericAttributeImpl to work with SqlAlchemy 2.0.22
  • Loading branch information
kurtmckee authored Jan 31, 2024
2 parents db32722 + 712aaba commit 00d8000
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sqlalchemy_utils/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@


class GenericAttributeImpl(attributes.ScalarAttributeImpl):
def __init__(self, *args, **kwargs):
# arguments received (class, key, dispatch)
# The attributes.AttributeImpl requires (class, key, default_function, dispatch)
# Setting None as default_function here
args = args[:2] + (None, ) + args[2:]
super().__init__(*args, **kwargs)

def get(self, state, dict_, passive=attributes.PASSIVE_OFF):
if self.key in dict_:
return dict_[self.key]
Expand Down

0 comments on commit 00d8000

Please sign in to comment.