@register.function
def license_link(license):
 from olympia.versions.models import License
 if isinstance(license, (long, int)):
  if (license in PERSONA_LICENSES_IDS):
   license = PERSONA_LICENSES_IDS[license]
  else:
   license = License.objects.filter(id=license)
   if (not license.exists()):
    return ''
   license = license[0]
 elif (not license):
  return ''
 if (not getattr(license, 'builtin', True)):
  return _('Custom License')
 template = get_env().get_template('amo/license_link.html')
 return jinja2.Markup(template.render({'license': license}))

@ register . function def license_link ( license ) : from olympia . versions . models import License if isinstance ( license , ( long , int ) ) : if ( license in PERSONA_LICENSES_IDS ) : license = PERSONA_LICENSES_IDS [ license ] else : license = License . objects . filter ( id = license ) if ( not license . exists ( ) ) : return '' license = license [ 0 ] elif ( not license ) : return '' if ( not getattr ( license , 'builtin' , True ) ) : return _ ( 'Custom License' ) template = get_env ( ) . get_template ( 'amo/license_link.html' ) return jinja2 . Markup ( template . render ( { 'license' : license } ) )
link to a code license .