oops that was a typo.. thanks for pointing that out... Yep I see atleast the
html elements getting displayed like those arrows...

on the views side I didnt get what f4nt meant.. can you show me an example?

Thanks
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 11:05 AM, Daniel Roseman <dan...@roseman.org.uk>wrote:

>
> On Oct 22, 6:20 pm, Dhruv Adhia <druf...@gmail.com> wrote:
> > Hello,
> >
> > Quite a basic question.. I am posting data from Unity, its like name
> > and score. I want to read the posted data and display it.
> >
> > Here is the code that I currently have inside views.py
> >
> > def add_score(request):
> >    response_dict ={}
> >    if request.POST:
> >        name = request.GET['name']
> >        score = request.GET['score']
> >        hash = request.GET['hash']
> >        response_dict = {'name': name, 'score': score, 'hash': hash}
> >    return render_to_response('add_score.html', response_dict)
> >
> > and template part
> >
> > <h1>Carbon Chaos leader board</h1>
> >
> > <ul>
> > {% for carbon_chaos in response_dict %}
> > <li>{{carbon_chaos.name}} >>> {{carbon_chaos.score}} >>>
> > {{carbon_chaos.hash}}</li>
> > {% endfor %}
> >
> > Can somebody point out what is the mistake?
> >
> > Thanks,
> > Dhruv
>
> As well as the view issue noted by f4nt, there are two further
> mistakes in the template:
> * response_dict is not an element in the context, it's what you have
> called the context within your view. In the template itself, the
> context elements are the keys/values in that dictionary.
> * There is no 'carbon_chaos' item in your context, so it doesn't make
> sense to iterate through it.
>
> So the template should look like this:
> <ul>
> <li>{{name}} >>> {{score}} >>> {{hash}}</li>
> </ul>
> --
> DR.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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