From 3b9bc7005f761c955dd8664c8141cc338f35ac91 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 28 Dec 2011 01:08:37 +0100 Subject: [PATCH] Added a utility class for manual dirty management. --- wrw/util.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wrw/util.py b/wrw/util.py index a0e4095..17fc7fb 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -58,3 +58,17 @@ class autodirty(sessiondata): super(autodirty, self).__delattr__(name, value) if "_is_dirty" in self.__dict__: self.__dict__["_is_dirty"] = True + +class manudirty(object): + def __init__(self, *args, **kwargs): + super(manudirty, self).__init__(*args, **kwargs) + self.__dirty = False + + def sessfrozen(self): + self.__dirty = False + + def sessdirty(self): + return self.__dirty + + def dirty(self): + self.__dirty = True -- 2.11.0