↧
Answer by Joseph Rajchwald for for loop with an integer in django's templates...
You can pass the range from the view to the template and then loop through that. Referencing this SO answer:View:render_to_response('template.html', {..., 'stars': range(review.stars), ...},...
View Articlefor loop with an integer in django's templates tags
In my Django template {{review.stars}} is an integer from 1 to 5, but instead of showing a simple number I want to show a number of star icons equal to the {{review.stars}} integer.I should write...
View Article
More Pages to Explore .....