def _clean_dirty(self, obj=None):
        """ Recursively clean self and all child objects. """
        obj = obj or self
        obj.__dict__['_dirty_attributes'].clear()
        obj._dirty = False
        for key, val in vars(obj).items():
            if isinstance(val, BaseObject):
                self._clean_dirty(val)
            else:
                func = getattr(val, '_clean_dirty', None)
                if callable(func):
                    func()
Recursively clean self and all child objects.