wbportfolio 1.50.8__py2.py3-none-any.whl → 1.50.10__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.
- wbportfolio/filters/assets.py +16 -14
- wbportfolio/filters/assets_and_net_new_money_progression.py +1 -1
- wbportfolio/filters/esg.py +2 -2
- wbportfolio/filters/performances.py +6 -6
- wbportfolio/filters/portfolios.py +2 -2
- wbportfolio/filters/positions.py +6 -6
- wbportfolio/filters/products.py +2 -2
- wbportfolio/filters/roles.py +1 -1
- wbportfolio/filters/signals.py +1 -1
- wbportfolio/filters/transactions/claim.py +9 -8
- wbportfolio/filters/transactions/fees.py +3 -2
- wbportfolio/filters/transactions/trades.py +1 -1
- wbportfolio/filters/transactions/transactions.py +2 -2
- wbportfolio/models/llm/wbcrm/analyze_relationship.py +13 -12
- wbportfolio/models/products.py +1 -1
- wbportfolio/models/transactions/claim.py +1 -2
- {wbportfolio-1.50.8.dist-info → wbportfolio-1.50.10.dist-info}/METADATA +1 -1
- {wbportfolio-1.50.8.dist-info → wbportfolio-1.50.10.dist-info}/RECORD +20 -20
- {wbportfolio-1.50.8.dist-info → wbportfolio-1.50.10.dist-info}/WHEEL +0 -0
- {wbportfolio-1.50.8.dist-info → wbportfolio-1.50.10.dist-info}/licenses/LICENSE +0 -0
wbportfolio/filters/assets.py
CHANGED
|
@@ -123,7 +123,7 @@ class DateFilterMixin:
|
|
|
123
123
|
|
|
124
124
|
class AssetPositionFilter(wb_filters.FilterSet):
|
|
125
125
|
date = wb_filters.DateFilter(
|
|
126
|
-
label="Date", lookup_expr="exact", field_name="date",
|
|
126
|
+
label="Date", lookup_expr="exact", field_name="date", initial=get_latest_asset_position, required=True
|
|
127
127
|
)
|
|
128
128
|
|
|
129
129
|
underlying_instrument__is_cash = wb_filters.BooleanFilter(
|
|
@@ -178,7 +178,7 @@ class AssetPositionFilter(wb_filters.FilterSet):
|
|
|
178
178
|
filter_params=get_asset_filter_param,
|
|
179
179
|
)
|
|
180
180
|
hide_empty_position = wb_filters.BooleanFilter(
|
|
181
|
-
|
|
181
|
+
initial=False, method="boolean_hide_empty_position", label="Hide Empty Position"
|
|
182
182
|
)
|
|
183
183
|
|
|
184
184
|
total_value_fx_usd = wb_filters.NumberFilter(label="Total Value ($)")
|
|
@@ -261,7 +261,7 @@ class AssetPositionFilter(wb_filters.FilterSet):
|
|
|
261
261
|
|
|
262
262
|
class AssetPositionPortfolioFilter(AssetPositionFilter):
|
|
263
263
|
portfolio_instrument = portfolio = None
|
|
264
|
-
aggregate = wb_filters.BooleanFilter(
|
|
264
|
+
aggregate = wb_filters.BooleanFilter(initial=False, required=True, label="Aggregate", method="filter_aggregate")
|
|
265
265
|
|
|
266
266
|
def filter_aggregate(self, queryset, name, value):
|
|
267
267
|
if value:
|
|
@@ -314,14 +314,14 @@ class AssetPositionInstrumentFilter(AssetPositionFilter):
|
|
|
314
314
|
label="Date",
|
|
315
315
|
lookup_expr="exact",
|
|
316
316
|
field_name="date",
|
|
317
|
-
|
|
317
|
+
initial=get_latest_asset_position,
|
|
318
318
|
method="filter_date",
|
|
319
319
|
required=True,
|
|
320
320
|
)
|
|
321
321
|
filter_last_positions = wb_filters.BooleanFilter(label="Fetch last position", method="fake_filter")
|
|
322
322
|
|
|
323
323
|
hide_aggregated_position = wb_filters.BooleanFilter(
|
|
324
|
-
|
|
324
|
+
initial=False, method="boolean_hide_aggregated_position", label="Hide Position from Aggregated Product"
|
|
325
325
|
)
|
|
326
326
|
|
|
327
327
|
def boolean_hide_aggregated_position(self, queryset, name, value):
|
|
@@ -368,7 +368,7 @@ class CashPositionPortfolioFilterSet(wb_filters.FilterSet):
|
|
|
368
368
|
)
|
|
369
369
|
|
|
370
370
|
date = wb_filters.DateFilter(
|
|
371
|
-
label="Date", lookup_expr="exact", field_name="date",
|
|
371
|
+
label="Date", lookup_expr="exact", field_name="date", initial=get_latest_asset_position, required=True
|
|
372
372
|
)
|
|
373
373
|
|
|
374
374
|
class Meta:
|
|
@@ -394,14 +394,14 @@ class DistributionFilter(wb_filters.FilterSet):
|
|
|
394
394
|
label="Date",
|
|
395
395
|
lookup_expr="exact",
|
|
396
396
|
field_name="date",
|
|
397
|
-
|
|
397
|
+
initial=latest_portfolio_date_based_on_instrument,
|
|
398
398
|
required=True,
|
|
399
399
|
)
|
|
400
400
|
|
|
401
401
|
group_by = wb_filters.ChoiceFilter(
|
|
402
402
|
label="Group By",
|
|
403
403
|
choices=AssetPositionGroupBy.choices(),
|
|
404
|
-
|
|
404
|
+
initial=AssetPositionGroupBy.INDUSTRY.name,
|
|
405
405
|
method="fake_filter",
|
|
406
406
|
clearable=False,
|
|
407
407
|
required=True,
|
|
@@ -414,13 +414,13 @@ class DistributionFilter(wb_filters.FilterSet):
|
|
|
414
414
|
value_key=Portfolio.get_representation_value_key(),
|
|
415
415
|
label_key=Portfolio.get_representation_label_key(),
|
|
416
416
|
filter_params=get_portfolio_filter_params,
|
|
417
|
-
|
|
417
|
+
initial=get_portfolio_default,
|
|
418
418
|
required=True,
|
|
419
419
|
clearable=False,
|
|
420
420
|
)
|
|
421
421
|
|
|
422
422
|
group_by_classification_group = wb_filters.ModelChoiceFilter(
|
|
423
|
-
|
|
423
|
+
initial=lambda k, v, f: get_default_classification_group().id,
|
|
424
424
|
method=lambda queryset, label, value: queryset,
|
|
425
425
|
label="Group by Classification Group",
|
|
426
426
|
queryset=ClassificationGroup.objects.all(),
|
|
@@ -445,7 +445,7 @@ class ContributionChartFilter(wb_filters.FilterSet):
|
|
|
445
445
|
label="Date Range",
|
|
446
446
|
required=True,
|
|
447
447
|
clearable=False,
|
|
448
|
-
|
|
448
|
+
initial=current_financial_month,
|
|
449
449
|
)
|
|
450
450
|
hedged_currency = wb_filters.ModelChoiceFilter(
|
|
451
451
|
label="Hedged Currency",
|
|
@@ -454,7 +454,7 @@ class ContributionChartFilter(wb_filters.FilterSet):
|
|
|
454
454
|
value_key=Currency.get_representation_value_key(),
|
|
455
455
|
label_key=Currency.get_representation_label_key(),
|
|
456
456
|
method=lambda queryset, label, value: queryset,
|
|
457
|
-
|
|
457
|
+
initial=get_default_hedged_currency,
|
|
458
458
|
)
|
|
459
459
|
|
|
460
460
|
class Meta:
|
|
@@ -463,7 +463,9 @@ class ContributionChartFilter(wb_filters.FilterSet):
|
|
|
463
463
|
|
|
464
464
|
|
|
465
465
|
class CompositionContributionChartFilter(ContributionChartFilter):
|
|
466
|
-
show_lookthrough = wb_filters.BooleanFilter(
|
|
466
|
+
show_lookthrough = wb_filters.BooleanFilter(
|
|
467
|
+
label="Show Lookthrough", initial=False, required=True, method="fake_filter"
|
|
468
|
+
)
|
|
467
469
|
|
|
468
470
|
|
|
469
471
|
class AssetPositionUnderlyingInstrumentChartFilter(DateFilterMixin, wb_filters.FilterSet):
|
|
@@ -481,7 +483,7 @@ class AssetPositionUnderlyingInstrumentChartFilter(DateFilterMixin, wb_filters.F
|
|
|
481
483
|
|
|
482
484
|
|
|
483
485
|
class CompositionModelPortfolioPandasFilter(PandasFilterSetMixin, wb_filters.FilterSet):
|
|
484
|
-
date = wb_filters.DateFilter(label="Date", lookup_expr="exact",
|
|
486
|
+
date = wb_filters.DateFilter(label="Date", lookup_expr="exact", initial=get_latest_asset_position, required=True)
|
|
485
487
|
|
|
486
488
|
class Meta:
|
|
487
489
|
model = AssetPosition
|
|
@@ -12,7 +12,7 @@ class AssetsAndNetNewMoneyProgressionFilterSet(filters.FilterSet):
|
|
|
12
12
|
method=lambda queryset, label, value: queryset,
|
|
13
13
|
required=True,
|
|
14
14
|
clearable=False,
|
|
15
|
-
|
|
15
|
+
initial=financial_year_to_date,
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
product = filters.ModelChoiceFilter(
|
wbportfolio/filters/esg.py
CHANGED
|
@@ -8,12 +8,12 @@ from .assets import get_latest_asset_position
|
|
|
8
8
|
|
|
9
9
|
class ESGMetricAggregationPortfolioPandasFilterSet(wb_filters.FilterSet):
|
|
10
10
|
date = wb_filters.DateFilter(
|
|
11
|
-
label="Date", lookup_expr="exact", field_name="date",
|
|
11
|
+
label="Date", lookup_expr="exact", field_name="date", initial=get_latest_asset_position, required=True
|
|
12
12
|
)
|
|
13
13
|
|
|
14
14
|
esg_aggregation = wb_filters.ChoiceFilter(
|
|
15
15
|
choices=ESGAggregation.choices(),
|
|
16
|
-
|
|
16
|
+
initial=ESGAggregation.GHG_EMISSIONS_SCOPE_1.name,
|
|
17
17
|
required=True,
|
|
18
18
|
method="fake_filter",
|
|
19
19
|
)
|
|
@@ -21,20 +21,20 @@ class PerformancePandasFilter(PandasFilterSetMixin, BaseProductFilterSet):
|
|
|
21
21
|
AUM = "AUM", "AUM"
|
|
22
22
|
PRICE = "PRICE", "Price"
|
|
23
23
|
|
|
24
|
-
is_forex_fix = wb_filters.BooleanFilter(label="Fix Forex rate", method="fake_filter",
|
|
24
|
+
is_forex_fix = wb_filters.BooleanFilter(label="Fix Forex rate", method="fake_filter", initial=False, required=True)
|
|
25
25
|
|
|
26
26
|
date = wb_filters.FinancialPerformanceDateRangeFilter(
|
|
27
27
|
label="Date Range",
|
|
28
28
|
method=lambda queryset, label, value: queryset,
|
|
29
29
|
required=True,
|
|
30
30
|
clearable=False,
|
|
31
|
-
|
|
31
|
+
initial=current_financial_month,
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
performance_by = wb_filters.ChoiceFilter(
|
|
35
35
|
label="Performance By",
|
|
36
36
|
choices=PerformanceBy.choices,
|
|
37
|
-
|
|
37
|
+
initial=PerformanceBy.PRICE.name,
|
|
38
38
|
method="fake_filter",
|
|
39
39
|
clearable=False,
|
|
40
40
|
required=True,
|
|
@@ -91,7 +91,7 @@ class PerformancePandasFilter(PandasFilterSetMixin, BaseProductFilterSet):
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
class ProductPerformanceNetNewMoneyFilter(PandasFilterSetMixin, BaseProductFilterSet):
|
|
94
|
-
is_active = wb_filters.BooleanFilter(label="Is Active", method="filter_active_products",
|
|
94
|
+
is_active = wb_filters.BooleanFilter(label="Is Active", method="filter_active_products", initial=True)
|
|
95
95
|
net_negative_money__gte = wb_filters.NumberFilter(
|
|
96
96
|
label="Net Negative money", lookup_expr="gte", field_name="net_negative_money"
|
|
97
97
|
)
|
|
@@ -126,7 +126,7 @@ class ProductPerformanceNetNewMoneyFilter(PandasFilterSetMixin, BaseProductFilte
|
|
|
126
126
|
method=lambda queryset, label, value: queryset,
|
|
127
127
|
required=True,
|
|
128
128
|
clearable=False,
|
|
129
|
-
|
|
129
|
+
initial=last_period_date_range,
|
|
130
130
|
)
|
|
131
131
|
|
|
132
132
|
def filter_active_products(self, queryset, name, value):
|
|
@@ -164,7 +164,7 @@ class PerformanceComparisonFilter(PandasFilterSetMixin, BaseProductFilterSet):
|
|
|
164
164
|
method="fake_filter",
|
|
165
165
|
)
|
|
166
166
|
compare_primary_benchmark = wb_filters.BooleanFilter(
|
|
167
|
-
|
|
167
|
+
initial=False, label="Compare against primary benchmark", method="fake_filter"
|
|
168
168
|
)
|
|
169
169
|
|
|
170
170
|
class Meta:
|
|
@@ -6,7 +6,7 @@ from wbportfolio.models import Portfolio
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class PortfolioFilterSet(wb_filters.FilterSet):
|
|
9
|
-
is_tracked = wb_filters.BooleanFilter(
|
|
9
|
+
is_tracked = wb_filters.BooleanFilter(initial=True, label="Is tracked")
|
|
10
10
|
instrument = wb_filters.ModelChoiceFilter(
|
|
11
11
|
label="Instrument",
|
|
12
12
|
queryset=Instrument.objects.all(),
|
|
@@ -37,7 +37,7 @@ class PortfolioFilterSet(wb_filters.FilterSet):
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class PortfolioTreeGraphChartFilterSet(wb_filters.FilterSet):
|
|
40
|
-
date = wb_filters.DateFilter(method="fake_filter",
|
|
40
|
+
date = wb_filters.DateFilter(method="fake_filter", initial=get_latest_asset_position, required=True)
|
|
41
41
|
|
|
42
42
|
class Meta:
|
|
43
43
|
model = Portfolio
|
wbportfolio/filters/positions.py
CHANGED
|
@@ -80,20 +80,20 @@ class AssetPositionPandasFilter(DateFilterMixin, PandasFilterSetMixin, wb_filter
|
|
|
80
80
|
label="Date Range",
|
|
81
81
|
required=True,
|
|
82
82
|
clearable=False,
|
|
83
|
-
|
|
83
|
+
initial=current_financial_month,
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
group_by = wb_filters.ChoiceFilter(
|
|
87
87
|
label="Group By",
|
|
88
88
|
choices=GroupbyChoice.choices,
|
|
89
|
-
|
|
89
|
+
initial=GroupbyChoice.UNDERLYING_INSTRUMENT,
|
|
90
90
|
method="fake_filter",
|
|
91
91
|
clearable=False,
|
|
92
92
|
required=True,
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
groupby_classification_height = wb_filters.NumberFilter(
|
|
96
|
-
method="fake_filter", label="Classification Height (groupby)",
|
|
96
|
+
method="fake_filter", label="Classification Height (groupby)", initial=0, clearable=False, required=True
|
|
97
97
|
)
|
|
98
98
|
|
|
99
99
|
class Meta:
|
|
@@ -168,17 +168,17 @@ class AggregatedAssetPositionLiquidityFilter(PandasFilterSetMixin, wb_filters.Fi
|
|
|
168
168
|
historic_date = wb_filters.DateFilter(
|
|
169
169
|
label="Historic Date",
|
|
170
170
|
method=lambda queryset, label, value: queryset,
|
|
171
|
-
|
|
171
|
+
initial=get_latest_date_based_on_multiple_models,
|
|
172
172
|
required=True,
|
|
173
173
|
)
|
|
174
174
|
compared_date = wb_filters.DateFilter(
|
|
175
175
|
label="Compared Date",
|
|
176
176
|
method=lambda queryset, label, value: queryset,
|
|
177
|
-
|
|
177
|
+
initial=get_latest_end_quarter_date_asset_position,
|
|
178
178
|
required=True,
|
|
179
179
|
)
|
|
180
180
|
bigger_than_x = wb_filters.NumberFilter(
|
|
181
|
-
label="Bigger Than..", method=lambda queryset, label, value: queryset,
|
|
181
|
+
label="Bigger Than..", method=lambda queryset, label, value: queryset, initial=1.00, required=True, precision=2
|
|
182
182
|
)
|
|
183
183
|
|
|
184
184
|
class Meta:
|
wbportfolio/filters/products.py
CHANGED
|
@@ -42,7 +42,7 @@ class BaseProductFilterSet(InstrumentFilterSet):
|
|
|
42
42
|
label_key=ProductGroup.get_representation_label_key(),
|
|
43
43
|
)
|
|
44
44
|
is_invested = wb_filters.BooleanFilter(label="Invested")
|
|
45
|
-
is_active = wb_filters.BooleanFilter(label="Only Active", method="filter_is_active",
|
|
45
|
+
is_active = wb_filters.BooleanFilter(label="Only Active", method="filter_is_active", initial=True)
|
|
46
46
|
|
|
47
47
|
class Meta:
|
|
48
48
|
model = Product
|
|
@@ -141,7 +141,7 @@ class ProductFeeFilter(BaseProductFilterSet):
|
|
|
141
141
|
method=lambda queryset, label, value: queryset,
|
|
142
142
|
required=True,
|
|
143
143
|
clearable=False,
|
|
144
|
-
|
|
144
|
+
initial=last_period_date_range(),
|
|
145
145
|
)
|
|
146
146
|
|
|
147
147
|
def filter_active_products(self, queryset, name, value):
|
wbportfolio/filters/roles.py
CHANGED
|
@@ -6,7 +6,7 @@ from wbportfolio.models import PortfolioRole
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class PortfolioRoleFilterSet(wb_filters.FilterSet):
|
|
9
|
-
is_active = wb_filters.BooleanFilter(method="filter_is_active",
|
|
9
|
+
is_active = wb_filters.BooleanFilter(method="filter_is_active", initial=True, label="Is Active")
|
|
10
10
|
|
|
11
11
|
def filter_is_active(self, queryset, name, value):
|
|
12
12
|
if value is True:
|
wbportfolio/filters/signals.py
CHANGED
|
@@ -68,6 +68,6 @@ def add_classification_instrument_filter(sender, request=None, *args, **kwargs):
|
|
|
68
68
|
|
|
69
69
|
return {
|
|
70
70
|
"only_invested": wb_filters.BooleanFilter(
|
|
71
|
-
method=_filter_invested, label="Invested Instruments (last date)",
|
|
71
|
+
method=_filter_invested, label="Invested Instruments (last date)", initial=False
|
|
72
72
|
)
|
|
73
73
|
}
|
|
@@ -231,7 +231,7 @@ class ClaimGroupByFilter(CommissionBaseFilterSet):
|
|
|
231
231
|
group_by = wb_filters.ChoiceFilter(
|
|
232
232
|
label="Group By",
|
|
233
233
|
choices=ClaimGroupbyChoice.choices(),
|
|
234
|
-
|
|
234
|
+
initial=ClaimGroupbyChoice.PRODUCT.name,
|
|
235
235
|
method=lambda queryset, label, value: queryset,
|
|
236
236
|
required=True,
|
|
237
237
|
clearable=False,
|
|
@@ -242,11 +242,11 @@ class ClaimGroupByFilter(CommissionBaseFilterSet):
|
|
|
242
242
|
method=lambda queryset, label, value: queryset,
|
|
243
243
|
required=True,
|
|
244
244
|
clearable=False,
|
|
245
|
-
|
|
245
|
+
initial=year_to_date_range,
|
|
246
246
|
)
|
|
247
247
|
|
|
248
248
|
groupby_classification_group = wb_filters.ModelChoiceFilter(
|
|
249
|
-
|
|
249
|
+
initial=lambda k, v, f: get_default_classification_group().id,
|
|
250
250
|
method=lambda queryset, label, value: queryset,
|
|
251
251
|
label="Group by Classification Group",
|
|
252
252
|
queryset=ClassificationGroup.objects.all(),
|
|
@@ -324,7 +324,8 @@ class ConsolidatedTradeSummaryTableFilterSet(PandasFilterSetMixin, ClaimGroupByF
|
|
|
324
324
|
class DistributionNNMChartFilter(ClaimGroupByFilter):
|
|
325
325
|
percent = wb_filters.BooleanFilter(
|
|
326
326
|
method="fake_filter",
|
|
327
|
-
|
|
327
|
+
initial=False,
|
|
328
|
+
required=True,
|
|
328
329
|
help_text="True if the value are displayed in percentage of the initial total AUM",
|
|
329
330
|
label="Show percentage",
|
|
330
331
|
)
|
|
@@ -338,10 +339,10 @@ class CumulativeNNMChartFilter(ClaimGroupByFilter):
|
|
|
338
339
|
groupby_classification_group = group_by = None
|
|
339
340
|
|
|
340
341
|
hide_projected_monthly_nnm_target = wb_filters.BooleanFilter(
|
|
341
|
-
|
|
342
|
+
initial=True, required=True, label="Hide Target line", method=lambda queryset, label, value: queryset
|
|
342
343
|
)
|
|
343
344
|
projected_monthly_nnm_target = wb_filters.NumberFilter(
|
|
344
|
-
|
|
345
|
+
initial=lambda k, v, f: get_monthly_nnm_target(),
|
|
345
346
|
method=lambda queryset, label, value: queryset,
|
|
346
347
|
label="Projected Monthly NNM Target",
|
|
347
348
|
)
|
|
@@ -369,7 +370,7 @@ class ProfitAndLossPandasFilter(PandasFilterSetMixin, ClaimFilter):
|
|
|
369
370
|
method=lambda queryset, label, value: queryset,
|
|
370
371
|
required=True,
|
|
371
372
|
clearable=False,
|
|
372
|
-
|
|
373
|
+
initial=current_financial_quarter,
|
|
373
374
|
)
|
|
374
375
|
|
|
375
376
|
class Meta:
|
|
@@ -426,7 +427,7 @@ class NegativeTermimalAccountPerProductFilterSet(wb_filters.FilterSet):
|
|
|
426
427
|
sum_shares__lte = wb_filters.NumberFilter(lookup_expr="lte", field_name="sum_shares", label="Total Shares")
|
|
427
428
|
|
|
428
429
|
only_approved = wb_filters.BooleanFilter(
|
|
429
|
-
|
|
430
|
+
initial=False, label="Only Approved claims", method="filter_only_approve_claims"
|
|
430
431
|
)
|
|
431
432
|
|
|
432
433
|
def filter_only_approve_claims(self, queryset, name, value):
|
|
@@ -18,7 +18,8 @@ class FeesFilter(TransactionFilterSet):
|
|
|
18
18
|
fee_date = wb_filters.DateRangeFilter(
|
|
19
19
|
method=wb_filters.DateRangeFilter.base_date_range_filter_method,
|
|
20
20
|
label="Date Range",
|
|
21
|
-
|
|
21
|
+
initial=get_transaction_default_date_range,
|
|
22
|
+
required=True,
|
|
22
23
|
)
|
|
23
24
|
total_value_usd__gte = total_value_usd__lte = transaction_underlying_type = transaction_date = None
|
|
24
25
|
|
|
@@ -59,7 +60,7 @@ class FeesAggregatedFilter(PandasFilterSetMixin, wb_filters.FilterSet):
|
|
|
59
60
|
method=wb_filters.DateRangeFilter.base_date_range_filter_method,
|
|
60
61
|
required=True,
|
|
61
62
|
clearable=False,
|
|
62
|
-
|
|
63
|
+
initial=current_quarter_date_range,
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
class Meta:
|
|
@@ -71,7 +71,7 @@ class TradeFilter(OppositeSharesFieldMethodMixin, TransactionFilterSet):
|
|
|
71
71
|
# )
|
|
72
72
|
total_value_usd__gte = total_value_usd__lte = transaction_underlying_type = None
|
|
73
73
|
marked_for_deletion = wb_filters.BooleanFilter(
|
|
74
|
-
label="Marked For Deletion",
|
|
74
|
+
label="Marked For Deletion", initial=False, field_name="marked_for_deletion", lookup_expr="exact"
|
|
75
75
|
)
|
|
76
76
|
pivot_date = wb_filters.DateFilter(hidden=True, method="filter_pivot_date")
|
|
77
77
|
|
|
@@ -47,7 +47,7 @@ class TransactionFilterSet(wb_filters.FilterSet):
|
|
|
47
47
|
transaction_date = wb_filters.DateRangeFilter(
|
|
48
48
|
method=wb_filters.DateRangeFilter.base_date_range_filter_method,
|
|
49
49
|
label="Date Range",
|
|
50
|
-
|
|
50
|
+
initial=get_transaction_default_date_range,
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
portfolio = wb_filters.ModelChoiceFilter(
|
|
@@ -94,6 +94,6 @@ class TransactionPortfolioFilterSet(TransactionFilterSet):
|
|
|
94
94
|
label="Transaction Date",
|
|
95
95
|
lookup_expr="exact",
|
|
96
96
|
field_name="transaction_date",
|
|
97
|
-
|
|
97
|
+
initial=get_transaction_lte_default,
|
|
98
98
|
required=True,
|
|
99
99
|
)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
from typing import TYPE_CHECKING
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
3
2
|
|
|
4
3
|
from django.db.models import F, FloatField, Sum
|
|
5
4
|
from django.db.models.functions import Cast, ExtractYear
|
|
@@ -11,7 +10,7 @@ if TYPE_CHECKING:
|
|
|
11
10
|
from wbcrm.models import Account
|
|
12
11
|
|
|
13
12
|
|
|
14
|
-
def get_holding_prompt(account: "Account") -> list["BaseMessage"]:
|
|
13
|
+
def get_holding_prompt(account: "Account") -> tuple[list["BaseMessage"], dict[str, Any]]:
|
|
15
14
|
from wbportfolio.models import Product
|
|
16
15
|
from wbportfolio.models.transactions.claim import Claim
|
|
17
16
|
|
|
@@ -23,19 +22,21 @@ def get_holding_prompt(account: "Account") -> list["BaseMessage"]:
|
|
|
23
22
|
|
|
24
23
|
performances = {}
|
|
25
24
|
for product_id, product_name in products:
|
|
26
|
-
performances[product_name] =
|
|
27
|
-
Product.objects.get(id=product_id).get_prices_df()
|
|
28
|
-
|
|
25
|
+
performances[product_name] = (
|
|
26
|
+
Instrument.extract_annual_performance_df(Product.objects.get(id=product_id).get_prices_df())
|
|
27
|
+
.set_index("year")["performance"]
|
|
28
|
+
.to_dict()
|
|
29
|
+
)
|
|
29
30
|
|
|
30
31
|
return [
|
|
31
32
|
SystemMessage(
|
|
32
33
|
"The following products are held by the account holder. Analyze their performances and check correlations between the holdings and their performances/interactions."
|
|
33
34
|
),
|
|
34
|
-
HumanMessage(
|
|
35
|
-
]
|
|
35
|
+
HumanMessage("Performances per product ISIN per year: {performances}"),
|
|
36
|
+
], {"performances": performances}
|
|
36
37
|
|
|
37
38
|
|
|
38
|
-
def get_performances_prompt(account: "Account") -> list["BaseMessage"]:
|
|
39
|
+
def get_performances_prompt(account: "Account") -> tuple[list["BaseMessage"], dict[str, Any]]:
|
|
39
40
|
from wbportfolio.models.transactions.claim import Claim
|
|
40
41
|
|
|
41
42
|
holdings = (
|
|
@@ -48,11 +49,11 @@ def get_performances_prompt(account: "Account") -> list["BaseMessage"]:
|
|
|
48
49
|
product_isin=F("product__isin"),
|
|
49
50
|
)
|
|
50
51
|
.values("product_name", "product_isin", "sum_shares", "year")
|
|
51
|
-
)
|
|
52
|
+
).order_by("year", "product")
|
|
52
53
|
|
|
53
54
|
return [
|
|
54
55
|
SystemMessage(
|
|
55
56
|
"The following holdings (subscriptions/redemptions) have been found for this account. Please include this data in the analysis and check if there is any correlation between the holding data and the interactions."
|
|
56
57
|
),
|
|
57
|
-
HumanMessage(
|
|
58
|
-
]
|
|
58
|
+
HumanMessage("List of holdings for the account: {holdings}"),
|
|
59
|
+
], {"holdings": list(holdings)}
|
wbportfolio/models/products.py
CHANGED
|
@@ -34,11 +34,11 @@ from wbcrm.models.accounts import Account
|
|
|
34
34
|
from wbfdm.models.instruments.instrument_prices import InstrumentPrice
|
|
35
35
|
from wbfdm.models.instruments.instruments import InstrumentManager, InstrumentType
|
|
36
36
|
|
|
37
|
-
from wbportfolio.models.llm.wbcrm.analyze_relationship import get_holding_prompt
|
|
38
37
|
from wbportfolio.models.portfolio_relationship import InstrumentPortfolioThroughModel
|
|
39
38
|
|
|
40
39
|
from ..preferences import get_product_termination_notice_period
|
|
41
40
|
from . import PortfolioRole
|
|
41
|
+
from .llm.wbcrm.analyze_relationship import get_holding_prompt
|
|
42
42
|
from .mixins.instruments import PMSInstrument, PMSInstrumentAbstractModel
|
|
43
43
|
|
|
44
44
|
|
|
@@ -35,9 +35,8 @@ from wbcrm.models import AccountRole
|
|
|
35
35
|
from wbcrm.models.accounts import Account
|
|
36
36
|
from wbfdm.models.instruments.instrument_prices import InstrumentPrice
|
|
37
37
|
|
|
38
|
-
from wbportfolio.models.llm.wbcrm.analyze_relationship import get_performances_prompt
|
|
39
|
-
|
|
40
38
|
from ..custodians import Custodian
|
|
39
|
+
from ..llm.wbcrm.analyze_relationship import get_performances_prompt
|
|
41
40
|
from ..roles import PortfolioRole
|
|
42
41
|
from .trades import Trade
|
|
43
42
|
|
|
@@ -75,22 +75,22 @@ wbportfolio/factories/transactions.py,sha256=jZqTNRpW344DSYjV5tAqU5y30Kc7GRGbZ3B
|
|
|
75
75
|
wbportfolio/fdm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
wbportfolio/fdm/tasks.py,sha256=59hXt3TOJaM8KpUaKdBNAGsO7NFMHaAlNA0T3FTUau0,533
|
|
77
77
|
wbportfolio/filters/__init__.py,sha256=m44CdyYMtku8rMGyiX8KSmMdvyqaElKW4UMkEqOC1VM,1374
|
|
78
|
-
wbportfolio/filters/assets.py,sha256=
|
|
79
|
-
wbportfolio/filters/assets_and_net_new_money_progression.py,sha256=
|
|
78
|
+
wbportfolio/filters/assets.py,sha256=Tbci0xXuFzs2wCSMauhc-LsnB5LdmxcPVFk3AavM5z8,18158
|
|
79
|
+
wbportfolio/filters/assets_and_net_new_money_progression.py,sha256=IYl_qMFO9QKhXhCTtz2JrOjlAKdEkykNlu4DO_H7HkQ,1403
|
|
80
80
|
wbportfolio/filters/custodians.py,sha256=pStQgPQPhPpnt57_V7BuXbFXmRiZBEAiEeMFuQmt2NE,287
|
|
81
|
-
wbportfolio/filters/esg.py,sha256=
|
|
82
|
-
wbportfolio/filters/performances.py,sha256=
|
|
83
|
-
wbportfolio/filters/portfolios.py,sha256=
|
|
84
|
-
wbportfolio/filters/positions.py,sha256=
|
|
85
|
-
wbportfolio/filters/products.py,sha256=
|
|
86
|
-
wbportfolio/filters/roles.py,sha256
|
|
87
|
-
wbportfolio/filters/signals.py,sha256=
|
|
81
|
+
wbportfolio/filters/esg.py,sha256=ZEUQh3IQxLSshVrgtPqHC_ToirrllkCXR_KzUlCUtkA,688
|
|
82
|
+
wbportfolio/filters/performances.py,sha256=xJC7fe8XNPz159cewMD8Es8u89vzgpZT4D2Gm1YToM8,7340
|
|
83
|
+
wbportfolio/filters/portfolios.py,sha256=o5S5FaUnHTmtgpBPzEom7odypdyM_I2O6Lbhj7Oy4nU,1469
|
|
84
|
+
wbportfolio/filters/positions.py,sha256=7eMqwqnNd_owi2Mg-1Uf9K9K9SHSgdZ8CcYgWw49qgI,8548
|
|
85
|
+
wbportfolio/filters/products.py,sha256=jOoRKDm_2n2a-Y1dHWl1zjdrwy4Cek57Qa3Q10p_zzY,6492
|
|
86
|
+
wbportfolio/filters/roles.py,sha256=jb8WLzZ_e03x8XkAWuYAdPgMyre3h-rtgYXKJ3dqkhw,920
|
|
87
|
+
wbportfolio/filters/signals.py,sha256=XZ1d50yas47Xy57ZfmvCVjMSKojaoqrc5FHJBcVadtk,3144
|
|
88
88
|
wbportfolio/filters/transactions/__init__.py,sha256=WHAwqZLRTAS46lLscGJYtKYWyEknsY5MqeSD0ue1r-o,662
|
|
89
|
-
wbportfolio/filters/transactions/claim.py,sha256=
|
|
90
|
-
wbportfolio/filters/transactions/fees.py,sha256=
|
|
89
|
+
wbportfolio/filters/transactions/claim.py,sha256=eSykgNzcytMWWTmlGlaqBuh98vfOKoTLvA3cglc_jZ0,17951
|
|
90
|
+
wbportfolio/filters/transactions/fees.py,sha256=Oawed5qlhKTFbuq0inzz2vkjtEgLObnF--m-k4HC0G4,2157
|
|
91
91
|
wbportfolio/filters/transactions/mixins.py,sha256=TEV3MUsiQTeu4NdFYHMIIMonmC7CdFF80JTpWYIvfRQ,550
|
|
92
|
-
wbportfolio/filters/transactions/trades.py,sha256=
|
|
93
|
-
wbportfolio/filters/transactions/transactions.py,sha256=
|
|
92
|
+
wbportfolio/filters/transactions/trades.py,sha256=fJ_JjjgBjJd9US0MdjksscCDNIbcLTrWUTT8Nt4kVY4,9778
|
|
93
|
+
wbportfolio/filters/transactions/transactions.py,sha256=7rMpP3V1c0NuJyji-aJq76WPurLZpS9PGI8FgjB4a0A,3538
|
|
94
94
|
wbportfolio/fixtures/product_factsheets.yaml,sha256=z5o-viDbgwWkssDJXZYayasFgw1nJ0uiOiYrJNDkRtg,5455
|
|
95
95
|
wbportfolio/fixtures/wbportfolio.yaml.gz,sha256=902nxQZM6VcVcc0wI9AYaSedcJIfsK5letLF31j1Jdg,1479453
|
|
96
96
|
wbportfolio/fixtures/wbrisk_management.yaml.gz,sha256=alFDRu8S9R6IsaIkpJe_v36B2GvHgHeNJVumUB5m_NQ,155413
|
|
@@ -255,7 +255,7 @@ wbportfolio/models/portfolio_cash_targets.py,sha256=WmgG-etPisZsh2yaFQpz7EkpvAud
|
|
|
255
255
|
wbportfolio/models/portfolio_relationship.py,sha256=ZGECiPZiLdlk4uSamOrEfuzO0hduK6OMKJLUSnh5_kc,5190
|
|
256
256
|
wbportfolio/models/portfolio_swing_pricings.py,sha256=_LqYC1VRjnnFFmVqFPRdnbgYsVxocMVpClTk2dnooig,1778
|
|
257
257
|
wbportfolio/models/product_groups.py,sha256=qoT8qv6tRdD6zmNDxsHO6dtnWw1-TRnyS5NqOq_gwhI,7901
|
|
258
|
-
wbportfolio/models/products.py,sha256=
|
|
258
|
+
wbportfolio/models/products.py,sha256=CkI7SBKWXgMkIcaGijZ-ghc_pPq075YjNgH-LWk1XCc,22845
|
|
259
259
|
wbportfolio/models/registers.py,sha256=qA6T33t4gxFYnabQFBMd90WGIr6wxxirDLKDFqjOfok,4667
|
|
260
260
|
wbportfolio/models/roles.py,sha256=wF5Atp0xsJxDrYjmFw9XHgEOe_4C-lm4pppeYdymOrA,7343
|
|
261
261
|
wbportfolio/models/signals.py,sha256=jZKC43nIqVdLapwo3getIMSqPUwbK5M36MmvA50jY24,1041
|
|
@@ -263,7 +263,7 @@ wbportfolio/models/utils.py,sha256=iBdMjRCvr6aOL0nLgfSCWUKe0h39h3IGmUbYo6l9t6w,3
|
|
|
263
263
|
wbportfolio/models/graphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
264
264
|
wbportfolio/models/graphs/portfolio.py,sha256=NwkehWvTcyTYrKO5ku3eNNaYLuBwuLdSbTEuugGuSIU,6541
|
|
265
265
|
wbportfolio/models/graphs/utils.py,sha256=1AMpEE9mDuUZ82XgN2irxjCW1-LmziROhKevEBo0mJE,2347
|
|
266
|
-
wbportfolio/models/llm/wbcrm/analyze_relationship.py,sha256=
|
|
266
|
+
wbportfolio/models/llm/wbcrm/analyze_relationship.py,sha256=etKdmt9m6Ra5u7EA9t98RVSqFKpbFd4iwBVaH9T26M8,2320
|
|
267
267
|
wbportfolio/models/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
268
268
|
wbportfolio/models/mixins/instruments.py,sha256=SgBreTpa_X3uyCWo7t8B0VaTtl49IjmBMe4Pab6TjAM,6796
|
|
269
269
|
wbportfolio/models/mixins/liquidity_stress_test.py,sha256=whkzjtbOyl_ncNyaQBORb_Z_rDgcvfdTYPgqPolu7dA,58865
|
|
@@ -272,7 +272,7 @@ wbportfolio/models/reconciliations/account_reconciliation_lines.py,sha256=QP6M7h
|
|
|
272
272
|
wbportfolio/models/reconciliations/account_reconciliations.py,sha256=_teOTNePxua9C894auy8CvdOFsmUnQiOM2_TZAHvzY4,3955
|
|
273
273
|
wbportfolio/models/reconciliations/reconciliations.py,sha256=kF-BNhUoT4TCn1RIgPSkdEk1iX4NQeZlGGFd_ZulAZU,686
|
|
274
274
|
wbportfolio/models/transactions/__init__.py,sha256=R-4fHylrUf3773kGSEt09vtYj3LUlia5yf7rxHXjvHA,295
|
|
275
|
-
wbportfolio/models/transactions/claim.py,sha256=
|
|
275
|
+
wbportfolio/models/transactions/claim.py,sha256=XUSephKt-VkILe2i-Sd9aoVxB-50PJANCPIDLa_dKl4,25872
|
|
276
276
|
wbportfolio/models/transactions/dividends.py,sha256=92-jG8bZN9nU9oDubpu-UDH43Ri7kVjhqE_esOSmOzo,471
|
|
277
277
|
wbportfolio/models/transactions/expiry.py,sha256=vnNHdcC1hf2HP4rAbmoGgOfagBYKNFytqOwzOI0MlVI,144
|
|
278
278
|
wbportfolio/models/transactions/fees.py,sha256=ffvqo8I4A0l5rLi00jJ6sGot0jmnkoxaNsbDzdPLwCg,5712
|
|
@@ -522,7 +522,7 @@ wbportfolio/viewsets/transactions/rebalancing.py,sha256=6rIrdK0rtKL1afJ-tYfAGdQV
|
|
|
522
522
|
wbportfolio/viewsets/transactions/trade_proposals.py,sha256=iQpC_Thbj56SmM05vPRsF1JZguGBDaTUH3I-_iCHCV0,5958
|
|
523
523
|
wbportfolio/viewsets/transactions/trades.py,sha256=-yJ4j8NJTu2VWyhCq5BXGNND_925Ietoxx9k07SLVh0,21634
|
|
524
524
|
wbportfolio/viewsets/transactions/transactions.py,sha256=ixDp-nsNA8t_A06rBCT19hOMJHy0iRmdz1XKdV1OwAs,4450
|
|
525
|
-
wbportfolio-1.50.
|
|
526
|
-
wbportfolio-1.50.
|
|
527
|
-
wbportfolio-1.50.
|
|
528
|
-
wbportfolio-1.50.
|
|
525
|
+
wbportfolio-1.50.10.dist-info/METADATA,sha256=e_s5BwIt2n97gDO321AtrrM38advbJ1Q18XHUInpP8w,703
|
|
526
|
+
wbportfolio-1.50.10.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
|
527
|
+
wbportfolio-1.50.10.dist-info/licenses/LICENSE,sha256=jvfVH0SY8_YMHlsJHKe_OajiscQDz4lpTlqT6x24sVw,172
|
|
528
|
+
wbportfolio-1.50.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|