I'm trying to compare the current user logged on to user stored in the
database (using GAE - Google App Engine).

Here are my four attempts so far and their results:

1)       {%ifequal conference.userAdded user.email %}
2)       {%ifequal {conference.userAdded} {user.email} %}
3)       {%ifequal {{conference.userAdded}} {{user.email}} %}
4)       {%ifequal conference.userAdded params['user'].email %}

1) always false
2) always true
3) always true
4) always false


Here is my full template code (the else shows the values of the fields
I'm trying to compare, and when I do a view source in the browser,
they are definitely equal.

         {%ifequal {{conference.userAdded}} {{user.email}} %}
            &nbsp;<a href="{%url views.edit conference.key.id%}">
{{ forloop.counter }}</a>
         {%else%}
            &nbsp;{{ forloop.counter }} <br>{{user.email}}<br>
{{conference.userAdded}}
         {%endifequal%}


The user is coming from here in the view (from the "gift" sample I
downloaded, no changes to the "respond" method:

def respond(request, user, template, params=None):
  if params is None:
    params = {}
  if user:
    params['user'] = user
    params['sign_out'] = users.CreateLogoutURL('/')
    params['is_admin'] = (users.IsCurrentUserAdmin() and
                          'Dev' in os.getenv('SERVER_SOFTWARE'))
  else:
    params['sign_in'] = users.CreateLoginURL(request.path)
  if not template.endswith('.html'):
    template += '.html'
  return shortcuts.render_to_response(template, params)

Thanks,
Neal Walters




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to