tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2938-updates-to-pricing-snapshots-via-python-dont-survive-restartInfinite Kind: Discussion 2020-11-29T20:00:23Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/485876772020-08-30T12:15:36Z2020-08-30T12:15:36ZUpdates to pricing snapshots via python don't survive restart<div><p>Hi George,</p>
<p>Great question! It looks like you're calling .syncItem() on the security's currency object instead of on the individual snapshots. If you call snap.syncItem() once you have all of the data in your snapshot then that's all you should need to do. I'd avoid calling syncItem on the currency/security object itself since the changes were only made to the snapshot.</p>
<p>Thanks!<br>
Sean</p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/485876772020-08-30T19:03:44Z2020-08-30T19:03:44ZUpdates to pricing snapshots via python don't survive restart<div><p>Thank you Sean,<br>
That fixed it. Now I see that it makes sense to sync the individual<br>
rows (snapshots).</p>
<p>I've attached the corrected code. I appreciate the help.</p>
<p>-- George</p></div>george.dobbstag:infinitekind.tenderapp.com,2009-01-14:Comment/485876772020-08-30T19:51:54Z2020-08-30T19:51:54ZUpdates to pricing snapshots via python don't survive restart<div><p>Hi George,</p>
<p>The new code looks great, although I think I gave you bad advice about not calling .syncItem() on the overall security. Since you are setting the "current price" of the security it looks like you should still call syncItem() on it after that, otherwise the new current price might not be preserved.</p>
<p>Thanks!<br>
Sean</p></div>Sean Reilly