def attach_program_detail_url(programs):
 for program in programs:
  base = reverse('program_details_view', kwargs={'program_id': program['id']}).rstrip('/')
  slug = slugify(program['name'])
  program['detail_url'] = '{base}/{slug}'.format(base=base, slug=slug)
 return programs

def attach_program_detail_url ( programs ) : for program in programs : base = reverse ( 'program_details_view' , kwargs = { 'program_id' : program [ 'id' ] } ) . rstrip ( '/' ) slug = slugify ( program [ 'name' ] ) program [ 'detail_url' ] = '{base}/{slug}' . format ( base = base , slug = slug ) return programs
extend program representations by attaching a url to be used when linking to program details .