Reputation: 5069
I would like to know if is there any way to do a short if-else in the django template such as in php?
<?=$variable ? 'String for true' : 'String for false'?>
If variable value is true, display String for true
otherwise String for false
Upvotes: 7
Views: 10701