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

@ register . tag def get_blog_categories ( parser , token ) : try : ( tag_name , arg ) = token . contents . split ( None , 1 ) except ValueError : raise template . TemplateSyntaxError , ( '%s tag requires arguments' % token . contents . split ( ) [ 0 ] ) m = re . search ( 'as (\\w+)' , arg ) if ( not m ) : raise template . TemplateSyntaxError , ( '%s tag had invalid arguments' % tag_name ) var_name = m . groups ( ) [ 0 ] return BlogCategories ( var_name )
gets all blog categories .