On Mon, Aug 31, 2009 at 9:26 AM, Lokesh <lokeshmarema...@gmail.com> wrote:

>
> Hi,
>
> I am trying to check the check boxes while serve of a page.
>
> I will be passing the elements/indexes of an element(checkbox) as a
> list from FORM.
>
> Here is the sample code that I am trying to implement
>
> sampleForm():
>  check = [1,3,5]
>  hobbies_list = {'1':'Chess', '2':'Cricket', '3':'Tennis',
> '4':'Shuttle', '5':'BasketBall'}
>  return render_to_response(template.html, {'hoby_list': hobbies_list,
> 'check_list':check})
>
> template.html
> {% for hbyId, hbyVal in hoby_list.items %}
>  {% if hbyId in check_list %} ################### - Here I would like
> to check the existence of an element


http://code.djangoproject.com/ticket/8087

requests this.  I believe the latest patch supports the syntax you are
trying to use here.  The ticket is in design decision needed, so it's
unknown whether it will be accepted/implemented It rather moves towards more
programming in templates, which is generally not Django's template
philosophy.

Karen

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

Reply via email to