try this:

<option value="{{ machine.product_name }}">

Unquoted attributes are invalid HTML, and your browser is probably
treating the second half of the string as a separate attribute.


On Oct 21, 9:24 am, Govindarajan <[email protected]> wrote:
> First off I have to say that I am new to django. I am trying to get a
> value from drop down select in HTML part. This value has spaces in it.
> However, when I retrieve it in the view code only the text up to the
> first space gets retrieved. Is there a to retrieve the whole string
> with all the spaces preserved?
>
> Thanks,
> Govind
>
> HTML TEMPLATE:
>
> <select name="machine">
>       <option value='all'>ALL</option>
>       {% for machine in machines %}
>
>          <option value= {{ machine.product_name }} > {{ machine.product_name}}
> </option>
>          {% endfor %}
>    </select>
>
> find.py:
>
> if key == 'product':
>          value = request.GET['product']
>          Log('%s' %value)
>          if not (value == 'all'):
>             cores = cores.filter(product__build_num=value)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to