File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,30 @@ Will produce:
80
80
81
81
![ added-transaction] ( https://github.com/bvanelli/actualpy/blob/main/docs/static/added-transaction.png?raw=true )
82
82
83
+ ## Updating existing transactions
84
+
85
+ You may also update transactions using the SQLModel directly, you just need to make sure to commit the results at the
86
+ end:
87
+
88
+ ``` python
89
+ from actual import Actual
90
+ from actual.queries import get_transactions
91
+
92
+
93
+ with Actual(base_url = " http://localhost:5006" , password = " mypass" , file = " My budget" ) as actual:
94
+ for transaction in get_transactions(actual.session):
95
+ # change the transactions notes
96
+ if transaction.notes is not None and " my pattern" in transaction.notes:
97
+ transaction.notes = transaction.notes + " my suffix!"
98
+ # commit your changes!
99
+ actual.commit()
100
+
101
+ ```
102
+
103
+ > ** WARNING:** You can also modify the relationships, for example the ` transaction.payee.name ` , but you to be aware that
104
+ > this payee might be used for more than one transaction. Whenever the relationship is anything but 1:1, you have to
105
+ > track the changes already done to prevent modifying a field twice.
106
+
83
107
## Generating backups
84
108
85
109
You can use actualpy to generate regular backups of your server files. Here is a script that will backup your server
You can’t perform that action at this time.
0 commit comments