def import_undone_trades_data(uid: long): dt = UndoneTrade() dt.drop_collection() dt.user_id = uid dt.calculation_start_date = datetime.now() dt.calculation_start_date = datetime.now() dt.undue_trades_count = 2 dt.past_due_trades_count = 2 dt.arrear_trades_count = 3 dt.undue_trades_total_balance_of_last_year = 3000000000 dt.past_due_trades_total_balance_of_last_year = 2000000000 dt.arrear_trades_total_balance_of_last_year = 10000000 dt.save()
def import_undone_trades_data(uid: long): UndoneTrade.objects(user_id=uid).delete() dt = UndoneTrade() dt.drop_collection() dt.user_id = uid dt.calculation_start_date = datetime.now() dt.calculation_start_date = datetime.now() dt.undue_trades_count = 0 dt.past_due_trades_count = 0 dt.arrear_trades_count = 0 dt.undue_trades_total_balance_of_last_year = 45000000 dt.past_due_trades_total_balance_of_last_year = 0 dt.arrear_trades_total_balance_of_last_year = 0 dt.save()