def get_url_for_object(object): """ """ if isinstance(object, Page): return object.url else: return object.get_absolute_uri()