Dear redstreet0 - do you have a "real world" name by the way? - dealing with backreferences is moot now... there is no more backreference from Posting to Transaction. I cleaned up the definition of the Posting object and removed 'entry'. It turned out to be easy to do so I figured I'd simplify the API and make your life easier & that of others wanting to write plugins... less is more, and I love to delete code. I removed the data.entry_replace() helper as well. Apologies if this caused minor temporary breakage.
Change description is here: https://bitbucket.org/blais/beancount/src/c95dccb3a7efbdf75cce9171975b146533b15da2/CHANGES?at=default#CHANGES-138 New, simpler, definition of Posting: https://bitbucket.org/blais/beancount/src/c95dccb3a7efbdf75cce9171975b146533b15da2/src/python/beancount/core/data.py?at=default#data.py-322 Because of this change, the "Old Code" in your email should not work anymore, but it was equivalent to the "New Code". So you have to somehow keep track of the transaction if you need to mutate its postings list. You don't really need to use TxnPosting, this is just a little harmless "pair" container that I use to carry out the gymnastics of tracking a Posting's Transaction in the list of postings per account (in the "realization" code). See here for a description and a showcase of my ASCII-art crafting skillz: https://bitbucket.org/blais/beancount/src/c95dccb3a7efbdf75cce9171975b146533b15da2/src/python/beancount/core/realization.py?at=default#realization.py-207 I suppose you could reuse it here if you want to but it wouldn't be that much of an improvement: matches = [TxnPosting(t, p) for t in zerosum_txns for p in t.postings if p.account == "Expenses:Blah"] I hope this helps, On Wed, Aug 5, 2015 at 3:54 PM, <[email protected]> wrote: > Also, when I updated to this, I had to change: > data.entry_replace(entry, ...) > > to: > > entry._replace(...) > > Does this sound right? Was I doing it incorrectly in the first place? > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Ledger" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
