I have ForeignKey in my Django model which can be null.
group = models.ForeignKey(Group, null = True, blank = True)
In case of null value assigned I want to render some specific text in templates (eg. "No grooup assigned"). I use default filter
and it's OK except that I repeat this code in various templates. I am looking for solution that will alllow me to assign some display value for None to a FK from some model globally.
Like:
group = models.ForeignKey(Group, null = True, blank = True, display_if_none='No group assigned')
Is it possible?