(self, context)
Make sure this is actually a Node and render it.
Make sure this is actually a Node and render it.
Make sure this is actually a Node and render it .
def render(self, context):  # pylint: disable=g-bad-name
    """Make sure this is actually a Node and render it."""
    data = django_template.Variable(self._variable).resolve(context)
    if hasattr(data, 'GetLanguageModel') and hasattr(data, 'value'):
      model = data.GetLanguageModel()
      # TODO(user): Fix the fact that Arrays don't know their language
      #   model.

      try:
        return model.RenderDataValue(data)
      except ValueError as e:
        raise django_template.TemplateSyntaxError(
            'Variable (%s) with value (%s) is not an accepted DataValue '
            'type (%s) as exhibited by: ValueError(%s).' %
            (self._variable, data.value, data.data_type, e))
    else:
      raise django_template.TemplateSyntaxError(
          '(%s) is not a DataValue object.' % self._variable)
def render ( self , context ) : # pylint: disable=g-bad-name data = django_template . Variable ( self . _variable ) . resolve ( context ) if hasattr ( data , 'GetLanguageModel' ) and hasattr ( data , 'value' ) : model = data . GetLanguageModel ( ) # TODO(user): Fix the fact that Arrays don't know their language #   model. try : return model . RenderDataValue ( data ) except ValueError as e : raise django_template . TemplateSyntaxError ( 'Variable (%s) with value (%s) is not an accepted DataValue ' 'type (%s) as exhibited by: ValueError(%s).' % ( self . _variable , data . value , data . data_type , e ) ) else : raise django_template . TemplateSyntaxError ( '(%s) is not a DataValue object.' % self . _variable )