@register.tag<EOL>def get_relation_by_type_list(parser, token):
tokens = token.contents.split()<EOL>if len(tokens) not in (<NUM_LIT:6>, <NUM_LIT:7>):<EOL><INDENT>raise template.TemplateSyntaxError(<EOL>"<STR_LIT>" % tokens[<NUM_LIT:0>]<EOL>)<EOL><DEDENT>if tokens[<NUM_LIT:2>] != '<STR_LIT>':<EOL><INDENT>raise template.TemplateSyntaxError(<EOL>"<STR_LIT>" % tokens[<NUM_LIT:0>]<EOL>)<EOL><DEDENT>if tokens[<NUM_LIT:4>] != '<STR_LIT>':<EOL><INDENT>raise template.TemplateSyntaxError(<EOL>"<STR_LIT>" % tokens[<NUM_LIT:0>]<EOL>)<EOL><DEDENT>direction = '<STR_LIT>'<EOL>if len(tokens) == <NUM_LIT:7>:<EOL><INDENT>direction = tokens[<NUM_LIT:6>]<EOL><DEDENT>return RelationByTypeListNode(<EOL>name=tokens[<NUM_LIT:1>], obj=tokens[<NUM_LIT:3>], as_var=tokens[<NUM_LIT:5>], direction=direction<EOL>)<EOL>
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] %}