code: def get_relation_by_type_list(parser, token):
      
      tokens = token.contents.split()
      if len(tokens) not in (6, 7):
          raise template.TemplateSyntaxError(
              "%r tag requires 6 arguments" % tokens[0]
          )
  
      if tokens[2] != 'for':
          raise template.TemplateSyntaxError(
              "Third argument in %r tag must be 'for'" % tokens[0]
          )
  
      if tokens[4] != 'as':
          raise template.TemplateSyntaxError(
              "Fifth argument in %r tag must be 'as'" % tokens[0]
          )
  
      direction = 'forward'
      if len(tokens) == 7:
          direction = tokens[6]
  
      return RelationByTypeListNode(
          name=tokens[1], obj=tokens[3], as_var=tokens[5], direction=direction
      )
docs: Gets list of relations from object identified by a content type.
  
      Syntax::
  
          {% get_relation_list [content_type_app_label.content_type_model] for [object] as [varname] [direction] %}