def save_on_signal(obj, trans):
 signal = models.signals.pre_save
 def cb(sender, instance, **kw):
  if (instance is obj):
   is_new = (trans.autoid is None)
   trans.save(force_insert=is_new, force_update=(not is_new))
   signal.disconnect(cb)
 signal.connect(cb, sender=obj.__class__, weak=False)

def save_on_signal ( obj , trans ) : signal = models . signals . pre_save def cb ( sender , instance , ** kw ) : if ( instance is obj ) : is_new = ( trans . autoid is None ) trans . save ( force_insert = is_new , force_update = ( not is_new ) ) signal . disconnect ( cb ) signal . connect ( cb , sender = obj . __class__ , weak = False )
connect signals so the translation gets saved during obj .