None, False and True all available in template tags and filters. None, False , empty string ( '', "", """""" ) and empty lists / tuples are evaluated to False when evaluating if , so you can easily do
{% if profile.user.first_name == None %} {% if not profile.user.first_name %}
Hint: @fabiocerqueira is right, keep the logic for the models, limit the templates to a single level of presentation, and figure things out like in your model. Example:
# someapp/models.py class UserProfile(models.Model): user = models.OneToOneField('auth.User')
Hope this helps :)
Gerard Aug 14 2018-12-12T00: 00Z
source share