Opened 16 years ago

Last modified 16 years ago

#9330 closed

Template params - list type — at Version 1

Reported by: Souparnika <nishakv@…> Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

Hi,

When I try to pass a list variable as one of template params from one of my view using render_to_response method in the view it is getting as a string data type.

View code -

ids = getIds(id,project_slug)-> returns a list type (eg: ids = [11111L,222222L]
template_params = {'ids':ids}
return render_to_response(template, template_params,
                              context_instance=RequestContext(request))

Then in the view.html

var ids = {{ ids }};

But here it is having problems since it is considering as string data type.

Any suggestions will be very usefull.

Thanks,
Nisha.

Change History (1)

comment:1 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)

Unbreak description formatting (the preview button is your friend!).

What is the problem you are actually seeing here? Templates output strings, so there's no concept of a type in the output. What do you expect to see and what are you seeing? I suspect this is an incorrect expectation, rather than a bug, but if you could provide some more details that would be helpful.

Note: See TracTickets for help on using tickets.
Back to Top