Magritte #save inform the model?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Magritte #save inform the model?

keith1y
Hello,

I have a settings model which initializes from description defaults and
keeps its values as a properties dictionary. If when coding I happen to
change or remove a description, when I edit and save the settings the
stale description still remains in the properties dictionary.

I am looking for a hook with which I can tell the Memento, to clear the
old settings and write the new ones. Is there such a thing?
For example if the model knew it was about to be saved to it could clear
out/reset its values in anticipation.

best regards

Keith


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Magritte #save inform the model?

Lukas Renggli-2
> I am looking for a hook with which I can tell the Memento, to clear  
> the
> old settings and write the new ones. Is there such a thing?
> For example if the model knew it was about to be saved to it could  
> clear
> out/reset its values in anticipation.

You could implement your own Memento, but usually it is more  
complicated as the same descriptions could be used in many different  
objects.

For me, most of the time I don't worry about these old settings.  
Maybe you could run from time to time a batch job, that cleans up  
orphaned settings?

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki