def _preprocess_context_html(context):
 for key in context:
  if isinstance(context[key], BaseForm):
   form = context[key]
   for fname in form.fields:
    field = form.fields[fname]
    try:
     if (field.widget.attrs and ('popuplink' in field.widget.attrs)):
      field.help_text += ('<a href="%s" field="id_%s" id="link-%s" class="inline-link add-link popup-link">%s</a>' % (field.widget.attrs['popuplink'], fname, fname, _('New')))
    except Exception:
     pass
 return context

def _preprocess_context_html ( context ) : for key in context : if isinstance ( context [ key ] , BaseForm ) : form = context [ key ] for fname in form . fields : field = form . fields [ fname ] try : if ( field . widget . attrs and ( 'popuplink' in field . widget . attrs ) ) : field . help_text += ( '<a href="%s" field="id_%s" id="link-%s" class="inline-link add-link popup-link">%s</a>' % ( field . widget . attrs [ 'popuplink' ] , fname , fname , _ ( 'New' ) ) ) except Exception : pass return context
prepares context to be rendered for html .