'Toggles (or sets) in_navigation and invalidates the cms page cache'

def toggle_in_navigation(self, set_to=None):

    old = self.in_navigation
    if (set_to in [True, False]):
        self.in_navigation = set_to
    else:
        self.in_navigation = (not self.in_navigation)
    self.save()
    if (self.in_navigation != old):
        from cms.cache import invalidate_cms_page_cache
        invalidate_cms_page_cache()
    return self.in_navigation
