title: Django Templatetag with User objects
body: <p>I am trying to pass the user objects to my template via a templatetag. I first tried simple_tag but apparently it is only for strings? Anyway this is what I have so far:</p>
  
  <p>templatetags/profiles.py</p>
  
  <pre><code>from django.template import Library, Node, Template, VariableDoesNotExist, TemplateSyntaxError, \
                              Variable
  from django.utils.translation import ugettext as _
  from django.contrib.auth.models import User
  from django.conf import settings
  from django.core.exceptions import ImproperlyConfigured
  from django.db import models
  
  
  
  class userlist(Node):
      def __init__(self, format_string):
          self.format_string = format_string
      def render(self, context):
          try:
          users = self.format_string
          return users
          except VariableDoesNotExist:
              return None
  
  
  def get_profiles(parser, token):
      return userlist(User.objects.all())
  
  register = Library()
  register.tag('get_profiles', get_profiles)
  </code></pre>
  
  <p>This is what I have in my template to test it:</p>
  
  <pre><code>{% load profiles %} 
  {% get_profiles %}
  {% for p in get_profiles %} {{ p }} {% endfor %}
  </code></pre>
  
  <p>I only get <code>[, , , , ]</code> printed out or if I change <code>User.objects.all()</code> to <code>User.objects.count()</code> I get the correct number. The for iteration in my template doesn't seem to do anything. what is wrong?</p>