Commits

Kenneth Love committed d2a59c3

made db selection session-aware

  • Participants
  • Parent commits 9cfa2d3

Comments (0)

Files changed (1)

templates/index.html

 <form action="{{ url_for('change_db') }}" method="post">
 	<label for="redis_db">Redis DB:</label>
 	<select id="redis_db" name="redis_db">
-		<option value="0">0</option>
-		<option value="1">1</option>
-		<option value="2">2</option>
-		<option value="3">3</option>
-		<option value="4">4</option>
-		<option value="5">5</option>
-		<option value="6">6</option>
-		<option value="7">7</option>
-		<option value="8">8</option>
-		<option value="9">9</option>
+		{% for number in range(0, 9) %}
+		<option value="{{ number }}" {% if number == session.redis_db %}selected{% endif %}>{{ number }}</option>
+		{% endfor %}
 	</select>
 	<input type="submit" value="Go">
 </form>