def pre_save_title(instance, raw, **kwargs):
 page = instance.page
 page_languages = page.get_languages()
 if (not (instance.language in page_languages)):
  page_languages.append(instance.language)
  page.update_languages(page_languages)
 if (not page.publisher_is_draft):
  menu_pool.clear(page.site_id)
 if (instance.pk and (not hasattr(instance, 'tmp_path'))):
  instance.tmp_path = None
  try:
   instance.tmp_path = Title.objects.filter(pk=instance.pk).values_list('path')[0][0]
  except IndexError:
   pass
 if (instance.has_url_overwrite and instance.path):
  instance.path = instance.path.strip(' /')
 else:
  update_title(instance)
 apphook_pre_title_checker(instance, **kwargs)

def pre_save_title ( instance , raw , ** kwargs ) : page = instance . page page_languages = page . get_languages ( ) if ( not ( instance . language in page_languages ) ) : page_languages . append ( instance . language ) page . update_languages ( page_languages ) if ( not page . publisher_is_draft ) : menu_pool . clear ( page . site_id ) if ( instance . pk and ( not hasattr ( instance , 'tmp_path' ) ) ) : instance . tmp_path = None try : instance . tmp_path = Title . objects . filter ( pk = instance . pk ) . values_list ( 'path' ) [ 0 ] [ 0 ] except IndexError : pass if ( instance . has_url_overwrite and instance . path ) : instance . path = instance . path . strip ( ' /' ) else : update_title ( instance ) apphook_pre_title_checker ( instance , ** kwargs )
save old state to instance and setup path .