fix(balance): Replace deprecated sqlalchemy functions
continuous-integration/woodpecker the build failed
Details
continuous-integration/woodpecker the build failed
Details
This commit is contained in:
parent
d9be9430db
commit
22fbb526bb
|
@ -40,7 +40,7 @@ class Transaction(db.Model, ModelSerializeMixin):
|
|||
|
||||
@sender_id.expression
|
||||
def sender_id(cls):
|
||||
return db.select([User.userid]).where(cls._sender_id == User.id_).as_scalar()
|
||||
return db.select([User.userid]).where(cls._sender_id == User.id_).scalar_subquery()
|
||||
|
||||
@hybrid_property
|
||||
def receiver_id(self):
|
||||
|
@ -48,7 +48,7 @@ class Transaction(db.Model, ModelSerializeMixin):
|
|||
|
||||
@receiver_id.expression
|
||||
def receiver_id(cls):
|
||||
return db.select([User.userid]).where(cls._receiver_id == User.id_).as_scalar()
|
||||
return db.select([User.userid]).where(cls._receiver_id == User.id_).scalar_subquery()
|
||||
|
||||
@property
|
||||
def author_id(self):
|
||||
|
|
Loading…
Reference in New Issue