1👍
✅
Don’t use count
for that. Use exists
(docs).
user_entered_tld = Tld.objects.filter(FKtoClient=request.user, auth=False).exists()
{% if user_entered_tld %}
<h3>I have Tld's</h3>
{% endif %}
Some notes:
- Django latest version is 1.7 (on beta). It’s impossible you’re using 2.6.2 (that seems like a Python version)
- Don’t camel-case your variables. Use
user_entered_tld
instead of
UserEnteredTld
. It’s a good Python convention.
Source:stackexchange.com