mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-24 02:11:18 +01:00
27 lines
722 B
Python
27 lines
722 B
Python
from import_export import fields, resources
|
|
from import_export.widgets import ForeignKeyWidget
|
|
|
|
from apps.dca.models import DCAStrategy, DCAEntry
|
|
from apps.currencies.models import Currency
|
|
|
|
|
|
class DCAStrategyResource(resources.ModelResource):
|
|
target_currency = fields.Field(
|
|
attribute="target_currency",
|
|
column_name="target_currency",
|
|
widget=ForeignKeyWidget(Currency, "name"),
|
|
)
|
|
payment_currency = fields.Field(
|
|
attribute="payment_currency",
|
|
column_name="payment_currency",
|
|
widget=ForeignKeyWidget(Currency, "name"),
|
|
)
|
|
|
|
class Meta:
|
|
model = DCAStrategy
|
|
|
|
|
|
class DCAEntryResource(resources.ModelResource):
|
|
class Meta:
|
|
model = DCAEntry
|