mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
Cleanup some nitpicks
This commit is contained in:
parent
1176c16b93
commit
30b4f27152
|
@ -107,6 +107,7 @@ class CustomDataWrapper:
|
|||
@staticmethod
|
||||
def delete_custom_data(trade_id: int) -> None:
|
||||
_CustomData.session.query(_CustomData).filter(_CustomData.ft_trade_id == trade_id).delete()
|
||||
_CustomData.session.commit()
|
||||
|
||||
@staticmethod
|
||||
def get_custom_data(*, trade_id: int, key: Optional[str] = None) -> List[_CustomData]:
|
||||
|
|
|
@ -343,7 +343,6 @@ class LocalTrade:
|
|||
id: int = 0
|
||||
|
||||
orders: List[Order] = []
|
||||
custom_data: List[_CustomData] = []
|
||||
|
||||
exchange: str = ''
|
||||
pair: str = ''
|
||||
|
@ -1507,7 +1506,7 @@ class Trade(ModelBase, LocalTrade):
|
|||
innerjoin=True) # type: ignore
|
||||
custom_data: Mapped[List[_CustomData]] = relationship(
|
||||
"_CustomData", cascade="all, delete-orphan",
|
||||
lazy="raise") # type: ignore
|
||||
lazy="raise")
|
||||
|
||||
exchange: Mapped[str] = mapped_column(String(25), nullable=False) # type: ignore
|
||||
pair: Mapped[str] = mapped_column(String(25), nullable=False, index=True) # type: ignore
|
||||
|
@ -1613,7 +1612,6 @@ class Trade(ModelBase, LocalTrade):
|
|||
|
||||
CustomDataWrapper.delete_custom_data(trade_id=self.id)
|
||||
|
||||
_CustomData.session.commit()
|
||||
Trade.session.delete(self)
|
||||
Trade.commit()
|
||||
|
||||
|
|
|
@ -2099,6 +2099,7 @@ def test_Trade_object_idem():
|
|||
'get_mix_tag_performance',
|
||||
'get_trading_volume',
|
||||
'validate_string_len',
|
||||
'custom_data'
|
||||
)
|
||||
EXCLUDES2 = ('trades', 'trades_open', 'bt_trades_open_pp', 'bt_open_open_trade_count',
|
||||
'total_profit', 'from_json',)
|
||||
|
|
Loading…
Reference in New Issue
Block a user