mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-01 10:31:44 +02:00
Updated Import (markdown)
+22
-3
@@ -163,13 +163,25 @@ Transformations allow you to transform a value before it is coerced.
|
||||
|
||||
#### Target-specific fields
|
||||
|
||||
Some targets have specific fields:
|
||||
|
||||
##### `type`
|
||||
|
||||
For targets `account`, `category`, `account_group` you can set type to either "id" or "name". This will hel
|
||||
For targets `account`, `category`, `tags`, `entities` and `account_group` you can set type to either `id` or `name`. This will define what to filter for when creating new objects.
|
||||
|
||||
For targets `account_currency`, `account_exchange_currency` and `currency_exchange`, you can set type to either `id`, `name` or `code`. This will define what to filter for when creating new objects.
|
||||
|
||||
##### `create`
|
||||
|
||||
Some targets have specific fields
|
||||
For targets `tags`, `entities`, `tags`, `entities` and `account_group` you can set create to `true` or `false`. Defaulting to `true`. This will create new objects if they don't exist. This can only be used with type `name`.
|
||||
|
||||
##### `format`
|
||||
For targets `date` and `reference_date`, you **must** set the `format` config with a valid [Datetime format](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes). This can also be a list of formats, each one will be tried a match is found.
|
||||
|
||||
##### `detection_method`
|
||||
For target `type` you can set `detection_method` to `sign` for detecting transaction type from a amount sign (negative is Expense and positive is Income); `always_income` or `always_expense`.
|
||||
|
||||
For target `is_paid` you can set `detection_method` to `boolean` to detect basic boolean strings; `always_paid` or `always_unpaid`.
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -178,8 +190,15 @@ mapping:
|
||||
date:
|
||||
target: date
|
||||
source: transaction_date
|
||||
required: true
|
||||
format: "%Y-%m-%d"
|
||||
|
||||
reference_date:
|
||||
target: reference_date
|
||||
source: transaction_date
|
||||
format:
|
||||
- "%Y-%m-%d"
|
||||
- "%d-%m-%Y"
|
||||
- "%m-%d-%Y"
|
||||
|
||||
amount:
|
||||
target: amount
|
||||
|
||||
Reference in New Issue
Block a user