@contextfunction
def core_perspective_switch(context):
 response_format = 'html'
 request = context['request']
 try:
  user = request.user.profile
  current = user.get_perspective()
  perspectives = Object.filter_by_request(request, Perspective.objects)
 except:
  current = None
  perspectives = []
 context = {'current': current, 'perspectives': perspectives}
 context.update(csrf(request))
 return Markup(render_to_string('core/tags/perspective_switch', context, response_format=response_format))

@ contextfunction def core_perspective_switch ( context ) : response_format = 'html' request = context [ 'request' ] try : user = request . user . profile current = user . get_perspective ( ) perspectives = Object . filter_by_request ( request , Perspective . objects ) except : current = None perspectives = [ ] context = { 'current' : current , 'perspectives' : perspectives } context . update ( csrf ( request ) ) return Markup ( render_to_string ( 'core/tags/perspective_switch' , context , response_format = response_format ) )
quick perspective switcher .