@register.render_tag
def set_short_url_for(context, token):
 obj = context[token.split_contents()[1]]
 obj.set_short_url()
 return u''

@ register . render_tag def set_short_url_for ( context , token ) : obj = context [ token . split_contents ( ) [ 1 ] ] obj . set_short_url ( ) return u''
sets the short_url attribute of the given model for share links in the template .