Remove arrow from models.py

This commit is contained in:
Matthias 2021-04-13 11:55:03 +02:00
parent 59cfbbee17
commit 37c8fd6ad7

View File

@ -6,7 +6,6 @@ from datetime import datetime, timezone
from decimal import Decimal from decimal import Decimal
from typing import Any, Dict, List, Optional from typing import Any, Dict, List, Optional
import arrow
from sqlalchemy import (Boolean, Column, DateTime, Float, ForeignKey, Integer, String, from sqlalchemy import (Boolean, Column, DateTime, Float, ForeignKey, Integer, String,
create_engine, desc, func, inspect) create_engine, desc, func, inspect)
from sqlalchemy.exc import NoSuchModuleError from sqlalchemy.exc import NoSuchModuleError
@ -160,8 +159,8 @@ class Order(_DECL_BASE):
if self.status in ('closed', 'canceled', 'cancelled'): if self.status in ('closed', 'canceled', 'cancelled'):
self.ft_is_open = False self.ft_is_open = False
if order.get('filled', 0) > 0: if order.get('filled', 0) > 0:
self.order_filled_date = arrow.utcnow().datetime self.order_filled_date = datetime.now(timezone.utc)
self.order_update_date = arrow.utcnow().datetime self.order_update_date = datetime.now(timezone.utc)
@staticmethod @staticmethod
def update_orders(orders: List['Order'], order: Dict[str, Any]): def update_orders(orders: List['Order'], order: Dict[str, Any]):