# someapp/models.py
class UserProfile(models.Model):
user = models.OneToOneField('auth.User')
# other fields
def get_full_name(self):
if not self.user.first_name:
return
return ' '.join([self.user.first_name, self.user.last_name])
# template
\{\{ user.get_profile.get_full_name }}
{% for field in form.visible_fields %}
{% if field.name == 'some_field' %}
{% if field.value is Null %}
\{\{ 'No data found' }}
{% else %}
\{\{ field }}
{% endif %}
{% endif %}
{% endfor %}