@register.tag
def get_people(parser, token):
 try:
  (tag_name, arg) = token.contents.split(None, 1)
 except ValueError:
  raise template.TemplateSyntaxError, ('%s tag requires arguments' % token.contents.split()[0])
 m1 = re.search('as (\\w+)', arg)
 m2 = re.search('(.*?) as (\\w+)', arg)
 if (not m1):
  raise template.TemplateSyntaxError, ('%s tag had invalid arguments' % tag_name)
 else:
  var_name = m1.groups()[0]
  return GetPeople(var_name)
 if (not m2):
  raise template.TemplateSyntaxError, ('%s tag had invalid arguments' % tag_name)
 else:
  (format_string, var_name) = m2.groups()
  return GetPeople(var_name, format_string[0])

@ register . tag def get_people ( parser , token ) : try : ( tag_name , arg ) = token . contents . split ( None , 1 ) except ValueError : raise template . TemplateSyntaxError , ( '%s tag requires arguments' % token . contents . split ( ) [ 0 ] ) m1 = re . search ( 'as (\\w+)' , arg ) m2 = re . search ( '(.*?) as (\\w+)' , arg ) if ( not m1 ) : raise template . TemplateSyntaxError , ( '%s tag had invalid arguments' % tag_name ) else : var_name = m1 . groups ( ) [ 0 ] return GetPeople ( var_name ) if ( not m2 ) : raise template . TemplateSyntaxError , ( '%s tag had invalid arguments' % tag_name ) else : ( format_string , var_name ) = m2 . groups ( ) return GetPeople ( var_name , format_string [ 0 ] )
gets any number of latest posts and stores them in a varable .