[FR]: Implement comparability of model objects
Is your feature request related to a problem? Please describe.
Yes, I was running the following code:
oldtx = #... list of transactions ...
newtx = get_all_transactions(...)
newtx = [t for t in newtx if t not in oldtx]
And noticed that if you compare two different instances of the same transaction (ie: they are different instances, but representing the same transaction with the same id) they equate to False.
Describe the solution you'd like
Implement __eq__ on transaction objects. Or a more general solution could be on model objects if they have an id field.
Describe alternatives you've considered
As a workaround, I made a set of existing IDs and filter my new transaction list against those.
Additional context
No response
Yeah I'll definitely add this, can't believe I didn't think to add that at the time 👍
Thanks for your prompt response!
I realised one edge case, and that's where tags have been added to a transaction since the initial fetch (eg: via the app). I'm not sure the best way to handle this right now.