def get_create_or_change_title(request, instance, name_field=None):
 if (not instance.pk):
  return (_(u'New %s') % instance._meta.verbose_name)
 if name_field:
  name = getattr(instance, name_field, None)
 else:
  name = (u'%s' % instance)
 if name:
  return force_text(name)
 return (_(u'Unnamed %s') % instance._meta.verbose_name)

def get_create_or_change_title ( request , instance , name_field = None ) : if ( not instance . pk ) : return ( _ ( u'New %s' ) % instance . _meta . verbose_name ) if name_field : name = getattr ( instance , name_field , None ) else : name = ( u'%s' % instance ) if name : return force_text ( name ) return ( _ ( u'Unnamed %s' ) % instance . _meta . verbose_name )
get a title suitable for an create-or-update view .