Problem comparing keys in Appengine/Python
- by ana
I'm trying to create a relationship between "tables" with Appengine/Python. Imagine I have a "table" for items, and a table for colors. I save the color of an item by saving the color key as an atribute of the item.
That's working well, but this particular piece of code is not working:
<select id="colorKey" name="colorKey">
{% for color in colors %}
<option value="{{ color.key }}"{% if color.key = item.colorKey %} selected="selected"{% endif %}>
{{ color.name }} - {{ item.colorKey }} - {{ color.key }}
</option>
{% endfor %}
</select>
Since the {{ item.colorKey }} and {{ color.key }} variables are actually the same chain of characters, I only can think in a problem with the types.
{{ item.colorKey }} is a string for sure. But maybe {{ color.key }} is not?