Skip to content

Commit

Permalink
Latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Guy-Galil committed May 23, 2024
1 parent 9069886 commit 99509d1
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 7 deletions.
51 changes: 47 additions & 4 deletions djang/importer/field_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
{
"class_name": "importer.models.AssetDetails",
"field_name": "stock_code",
"column_title": ["מספר ני\"ע","מספר נ\"ע"],
"column_title": ["מספר ני\"ע","מספר נ\"ע","מספר הנייר","מספר נע במערכת","מספר נייר"],
"type": "extracted",
"ref_name":"details"
},
Expand Down Expand Up @@ -189,7 +189,7 @@
{
"class_name": "importer.models.AssetDetails",
"field_name": "interest_rate",
"column_title": ["שיעור ריבית","שעור הריבית","שעור ריבית"],
"column_title": ["תנאי ושיעור ריבית","שיעור ריבית","שעור הריבית","שעור ריבית"],
"type": "extracted",
"ref_name":"details"
},
Expand Down Expand Up @@ -217,7 +217,7 @@
{
"class_name": "importer.models.AssetDetails",
"field_name": "interest_dividend",
"column_title": ["פדיון ריבית דיבידנד","פידיון/ריבית לקבל","פדיון/ריבית/דיבידנד לקבל","פדיון/ריבית לקבל","פדיון/ ריבית/ דיבידנד לקבל"],
"column_title": ["פדיון ריבית דיבידנד","פידיון/ריבית לקבל","פדיון/ריבית/דיבידנד לקבל","פדיון/ריבית לקבל","פדיון/ ריבית/ דיבידנד לקבל","פדיון/ ריבית לקבל","פדיון/ ריבית לקבל*****"],
"type": "extracted",
"ref_name":"details"
},
Expand Down Expand Up @@ -294,7 +294,7 @@
{
"class_name": "importer.models.AssetDetails",
"field_name": "roi_in_period",
"column_title": ["שיעור התשואה במהלך התקופה"],
"column_title": ["שיעור התשואה במהלך התקופה","שעור תשואה במהלך התקופה"],
"type": "extracted",
"ref_name":"details"
},
Expand All @@ -311,7 +311,50 @@
"column_title": ["כתובת הנכס"],
"type": "extracted",
"ref_name":"details"
},
{
"class_name": "importer.models.AssetDetails",
"field_name": "average_interest_rate",
"column_title": ["שיעור ריבית ממוצע"],
"type": "extracted",
"ref_name":"details"
},
{
"class_name": "importer.models.AssetDetails",
"field_name": "asset_type",
"column_title": ["אופי הנכס"],
"type": "extracted",
"ref_name":"details"
},
{
"class_name": "importer.models.AssetDetails",
"field_name": "commitment",
"column_title": ["סכום ההתחייבות"],
"type": "extracted",
"ref_name":"details"
},
{
"class_name": "importer.models.AssetDetails",
"field_name": "effective_interest",
"column_title": ["ריבית אפקטיבית"],
"type": "extracted",
"ref_name":"details"
},
{
"class_name": "importer.models.AssetDetails",
"field_name": "coordinated_cost",
"column_title": ["עלות מתואמת","עלות מותאמת"],
"type": "extracted",
"ref_name":"details"
},
{
"class_name": "importer.models.AssetDetails",
"field_name": "commitment_end_date",
"column_title": ["תאריך סיום ההתחייבות","סיום התחייבות","תאריך סיום"],
"type": "extracted",
"ref_name":"details"
}

]
}
]
2 changes: 1 addition & 1 deletion djang/importer/management/commands/import_from_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def handle(self, *args, **options):
failed +=1
#xsls_ingester.xls_import(p, None)
self.stdout.write(
self.style.SUCCESS(str(datetime.datetime.now())+'Successfully imported {1} files, {2} files failed'.format(count, failed))
self.style.SUCCESS(str(datetime.datetime.now())+'Successfully imported {0} files, {1} files failed'.format(count, failed))
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2 on 2024-04-12 10:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('importer', '0011_alter_assetdetails_issuer_code'),
]

operations = [
migrations.AddField(
model_name='assetdetails',
name='average_interest_rate',
field=models.FloatField(null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 4.2 on 2024-04-12 11:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('importer', '0012_assetdetails_average_interest_rate'),
]

operations = [
migrations.AddField(
model_name='assetdetails',
name='asset_type',
field=models.CharField(max_length=255, null=True),
),
migrations.AddField(
model_name='assetdetails',
name='commitment',
field=models.FloatField(null=True),
),
migrations.AddField(
model_name='assetdetails',
name='commitment_end_date',
field=models.DateField(null=True),
),
migrations.AddField(
model_name='assetdetails',
name='coordinated_cost',
field=models.FloatField(null=True),
),
migrations.AddField(
model_name='assetdetails',
name='effective_interest',
field=models.FloatField(null=True),
),
]
6 changes: 6 additions & 0 deletions djang/importer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class AssetDetails(models.Model):
roi_in_period = models.FloatField(null=True)
estimated_value = models.FloatField(null=True)
address = models.CharField(max_length=255,null=True)
average_interest_rate = models.FloatField(null=True)
asset_type = models.CharField(max_length=255,null=True)
commitment = models.FloatField(null=True)
effective_interest = models.FloatField(null=True)
coordinated_cost = models.FloatField(null=True)
commitment_end_date = models.DateField(null=True)

class FilesNotIngested(models.Model):
file_name = models.CharField(max_length=255)
Expand Down
4 changes: 2 additions & 2 deletions djang/importer/services/xsls_ingester.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def save_first_tab(self):
kupa = self.kupa_exists()
if kupa is not None:
if kupa.company != self.reference_objects["kupa"].company or kupa.track != self.reference_objects["kupa"].track:
ptint("Warning: kupa not equals")
print("Warning: kupa not equals")
self.reference_objects["kupa"] = kupa
report = self.report_exists()
if report is not None:
Expand Down Expand Up @@ -305,7 +305,7 @@ def save_objects(self):
traceback.print_exc()
fni = importer.models.FilesNotIngested()
fni.file_name = self.file
fni.info = sh+"-" + type(o).__name__ +\
fni.info = type(o).__name__ +\
"\n\r+++"+str(e)
fni.save()

Expand Down

0 comments on commit 99509d1

Please sign in to comment.