@register.tag
def get_admin_log(parser, token):
 tokens = token.contents.split()
 if (len(tokens) < 4):
  raise template.TemplateSyntaxError("'get_admin_log' statements require two arguments")
 if (not tokens[1].isdigit()):
  raise template.TemplateSyntaxError("First argument to 'get_admin_log' must be an integer")
 if (tokens[2] != 'as'):
  raise template.TemplateSyntaxError("Second argument to 'get_admin_log' must be 'as'")
 if (len(tokens) > 4):
  if (tokens[4] != 'for_user'):
   raise template.TemplateSyntaxError("Fourth argument to 'get_admin_log' must be 'for_user'")
 return AdminLogNode(limit=tokens[1], varname=tokens[3], user=(tokens[5] if (len(tokens) > 5) else None))

@ register . tag def get_admin_log ( parser , token ) : tokens = token . contents . split ( ) if ( len ( tokens ) < 4 ) : raise template . TemplateSyntaxError ( "'get_admin_log' statements require two arguments" ) if ( not tokens [ 1 ] . isdigit ( ) ) : raise template . TemplateSyntaxError ( "First argument to 'get_admin_log' must be an integer" ) if ( tokens [ 2 ] != 'as' ) : raise template . TemplateSyntaxError ( "Second argument to 'get_admin_log' must be 'as'" ) if ( len ( tokens ) > 4 ) : if ( tokens [ 4 ] != 'for_user' ) : raise template . TemplateSyntaxError ( "Fourth argument to 'get_admin_log' must be 'for_user'" ) return AdminLogNode ( limit = tokens [ 1 ] , varname = tokens [ 3 ] , user = ( tokens [ 5 ] if ( len ( tokens ) > 5 ) else None ) )
populates a template variable with the admin log for the given criteria .