python - If, Else inside html using Django templates -
i have django project consists of many html pages.
i want add if else condition inside html tag return "none" whenever time stamp = 0000-00-00 00:00:00 , return time when it's not. code shown below, used tag time in date format.
<td>{{ table.start_time|date:"y-m-d g:i:s"}}</td>
i used tag:
<td>{{ table.start_time|date:"y-m-d g:i:s"|default:"none"}}</td>
thanks all!!
Comments
Post a Comment