wbportfolio 1.46.3__py2.py3-none-any.whl → 1.46.4__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wbportfolio might be problematic. Click here for more details.

@@ -1,4 +1,5 @@
1
1
  from datetime import datetime
2
+ from decimal import Decimal
2
3
  from typing import Any, Dict, Optional
3
4
 
4
5
  from django.db import models
@@ -66,6 +67,10 @@ class TradeImportHandler(ImportExportHandler):
66
67
 
67
68
  data["marked_for_deletion"] = data.get("marked_for_deletion", False)
68
69
 
70
+ for field in self.model._meta.get_fields():
71
+ if not (value := data.get(field.name, None)) is None and isinstance(field, models.DecimalField):
72
+ data[field.name] = Decimal(value)
73
+
69
74
  def _create_instance(self, data: Dict[str, Any], **kwargs) -> models.Model:
70
75
  if "transaction_date" not in data: # we might get only book date and not transaction date
71
76
  data["transaction_date"] = data["book_date"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbportfolio
3
- Version: 1.46.3
3
+ Version: 1.46.4
4
4
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
5
5
  License-File: LICENSE
6
6
  Requires-Dist: cryptography==3.4.*
@@ -115,7 +115,7 @@ wbportfolio/import_export/handlers/dividend.py,sha256=tftdVdAzNpKSSvouOtvJfzWL36
115
115
  wbportfolio/import_export/handlers/fees.py,sha256=XYH752IkNGYhhhwatp8nYa1zG1-YZFDkYW15dyQgOIg,2824
116
116
  wbportfolio/import_export/handlers/portfolio_cash_flow.py,sha256=2ODaquuC83RfmNwmQ-8TdhiASObfIems_B1g0yqaYTs,2733
117
117
  wbportfolio/import_export/handlers/register.py,sha256=sYyXkE8b1DPZ5monxylZn0kjxLVdNYYZR-p61dwEoDM,2271
118
- wbportfolio/import_export/handlers/trade.py,sha256=LIzXNEN7-tRWCUBvisgy8eTDL85JWO5c7iN06yJA-TI,10395
118
+ wbportfolio/import_export/handlers/trade.py,sha256=Wvj7aFzc4UXYU5dZSxqBkA9hBozHiKzwGSmF6g2-Zss,10635
119
119
  wbportfolio/import_export/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
120
  wbportfolio/import_export/parsers/default_mapping.py,sha256=KrO-X5CvQCeQoBYzFDxavoQGriyUSeI2QDx5ar_zo7A,1405
121
121
  wbportfolio/import_export/parsers/jpmorgan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -517,7 +517,7 @@ wbportfolio/viewsets/transactions/rebalancing.py,sha256=6rIrdK0rtKL1afJ-tYfAGdQV
517
517
  wbportfolio/viewsets/transactions/trade_proposals.py,sha256=fYTvvRk7k5xsBzbIgJvU4I4OrllF0VkhlrekD4GVgDk,4296
518
518
  wbportfolio/viewsets/transactions/trades.py,sha256=wdtEWN1V5wsmesR3mRxPmTJUIAmDmqaNsfIhOB57kqY,16330
519
519
  wbportfolio/viewsets/transactions/transactions.py,sha256=ixDp-nsNA8t_A06rBCT19hOMJHy0iRmdz1XKdV1OwAs,4450
520
- wbportfolio-1.46.3.dist-info/METADATA,sha256=oDO6H1uvqNe5ZlHMqFbR4LPQ2x7KfULE_ePXVkPF4pg,734
521
- wbportfolio-1.46.3.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
522
- wbportfolio-1.46.3.dist-info/licenses/LICENSE,sha256=jvfVH0SY8_YMHlsJHKe_OajiscQDz4lpTlqT6x24sVw,172
523
- wbportfolio-1.46.3.dist-info/RECORD,,
520
+ wbportfolio-1.46.4.dist-info/METADATA,sha256=LBAxC3QZKE6WC_N1GU_qjaePjDQK7cKDct9pQqUaBKw,734
521
+ wbportfolio-1.46.4.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
522
+ wbportfolio-1.46.4.dist-info/licenses/LICENSE,sha256=jvfVH0SY8_YMHlsJHKe_OajiscQDz4lpTlqT6x24sVw,172
523
+ wbportfolio-1.46.4.dist-info/RECORD,,