Hi,

My scenario is that users would have applied for some job opening. I need
to do something like the following in my templates :

{% if has_applied opening user %}
You have applied
{% else %}
Click to apply
{% endif %}

However, so far i have been using templatetags and got the following only:
{% has_applied opening user %}

This returns a True or False from the implementation in
templatetags/project_extras.py as:

@register.simple_tag
def has_applied(opening,user):
    applied = False
    try:
        connect = Connect.objects.get(user=user, connecting_to=opening)
        applied = True
    except:
        applied= False
    return applied

I get the correct True or False return from this function , but i am not
able to figure out how to use it with an if statement in the html
templates. Any pointers ?

Regards,
Vibhu


-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to