parameters: (request)
return_statement: return render_to_response('form_gallery.html', context_instance=context)
docstring: Return a list of urls for all the shared xls files. This could be
      made a lot prettier.
docstring_summary: Return a list of urls for all the shared xls files. This could be
      made a lot prettier.
docstring_tokens: Return a list of urls for all the shared xls files . This could be made a lot prettier .
function: def form_gallery(request):
      """
      Return a list of urls for all the shared xls files. This could be
      made a lot prettier.
      """
      context = RequestContext(request)
      if request.user.is_authenticated():
          context.loggedin_user = request.user
      context.shared_forms = XForm.objects.filter(shared=True)
      # build list of shared forms with cloned suffix
      id_strings_with_cloned_suffix = [
          x.id_string + XForm.CLONED_SUFFIX for x in context.shared_forms
      ]
      # build list of id_strings for forms this user has cloned
      context.cloned = [
          x.id_string.split(XForm.CLONED_SUFFIX)[0]
          for x in XForm.objects.filter(
              user__username=request.user.username,
              id_string__in=id_strings_with_cloned_suffix
          )
      ]
      return render_to_response('form_gallery.html', context_instance=context)
function_tokens: def form_gallery ( request ) : context = RequestContext ( request ) if request . user . is_authenticated ( ) : context . loggedin_user = request . user context . shared_forms = XForm . objects . filter ( shared = True ) # build list of shared forms with cloned suffix id_strings_with_cloned_suffix = [ x . id_string + XForm . CLONED_SUFFIX for x in context . shared_forms ] # build list of id_strings for forms this user has cloned context . cloned = [ x . id_string . split ( XForm . CLONED_SUFFIX ) [ 0 ] for x in XForm . objects . filter ( user__username = request . user . username , id_string__in = id_strings_with_cloned_suffix ) ] return render_to_response ( 'form_gallery.html' , context_instance = context )