@register.tag
@blocktag(end_prefix=u'end_')
def for_review_request_field(context, nodelist, review_request_details, fieldset):
 s = []
 request = context.get(u'request')
 if isinstance(fieldset, six.text_type):
  fieldset = get_review_request_fieldset(fieldset)
 for field_cls in fieldset.field_classes:
  try:
   field = field_cls(review_request_details, request=request)
  except Exception as e:
   logging.exception(u'Error instantiating field %r: %s', field_cls, e)
   continue
  try:
   if field.should_render(field.value):
    context.push()
    context[u'field'] = field
    s.append(nodelist.render(context))
    context.pop()
  except Exception as e:
   logging.exception(u'Error running should_render for field %r: %s', field_cls, e)
 return u''.join(s)

@ register . tag @ blocktag ( end_prefix = u'end_' ) def for_review_request_field ( context , nodelist , review_request_details , fieldset ) : s = [ ] request = context . get ( u'request' ) if isinstance ( fieldset , six . text_type ) : fieldset = get_review_request_fieldset ( fieldset ) for field_cls in fieldset . field_classes : try : field = field_cls ( review_request_details , request = request ) except Exception as e : logging . exception ( u'Error instantiating field %r: %s' , field_cls , e ) continue try : if field . should_render ( field . value ) : context . push ( ) context [ u'field' ] = field s . append ( nodelist . render ( context ) ) context . pop ( ) except Exception as e : logging . exception ( u'Error running should_render for field %r: %s' , field_cls , e ) return u'' . join ( s )
loops through all fields in a fieldset .