@library.global_function
def tag_vocab():
 return json.dumps(dict(((t[0], t[1]) for t in Tag.objects.values_list('name', 'slug'))))

@ library . global_function def tag_vocab ( ) : return json . dumps ( dict ( ( ( t [ 0 ] , t [ 1 ] ) for t in Tag . objects . values_list ( 'name' , 'slug' ) ) ) )
returns the tag vocabulary as a json object .