Re: Template syntax issues w dict

2015-05-02 Thread Bernardo Brik
just a small correction – lose the parens after items:
{% for org, num in attendees_per_org.items %}

On Friday, May 1, 2015 at 4:48:25 AM UTC-3, ADEWALE ADISA wrote:
>
> If I can understand your code, of seems you want a table of : Institution 
> | Number of attendees
> So if am right u can achive it this way :
>
> {% for org, num in attendees_per_org.items() %}
> 
> {{ org }}
> {{ num }}
> 
>   {% endfor %}
>
> Since your dataset is a dictionary, u need to use key,value to get 
> elements in both side. Also items() is also required.
> On May 1, 2015 8:22 AM, "Lachlan Musicman"  
> wrote:
>
>> Hola,
>>
>> Django shell gives right results, template doesn't: code here
>>
>> http://dpaste.com/1NJEKD8
>>
>> What am I doing wrong?
>>
>> L.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGBeqiN78i37JA9UJov7%2BAVbJzRt4c5YCX3em2XvN-QmefxSvg%40mail.gmail.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d130722e-737a-4116-8522-1ddf64d697f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Template syntax issues w dict

2015-05-01 Thread Lachlan Musicman
 .items

Damn.

Thanks
On May 1, 2015 17:48, "ADEWALE ADISA"  wrote:

> If I can understand your code, of seems you want a table of : Institution
> | Number of attendees
> So if am right u can achive it this way :
>
> {% for org, num in attendees_per_org.items() %}
> 
> {{ org }}
> {{ num }}
> 
>   {% endfor %}
>
> Since your dataset is a dictionary, u need to use key,value to get
> elements in both side. Also items() is also required.
> On May 1, 2015 8:22 AM, "Lachlan Musicman"  wrote:
>
>> Hola,
>>
>> Django shell gives right results, template doesn't: code here
>>
>> http://dpaste.com/1NJEKD8
>>
>> What am I doing wrong?
>>
>> L.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGBeqiN78i37JA9UJov7%2BAVbJzRt4c5YCX3em2XvN-QmefxSvg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMGzuy_WwAKnYddxrYBL5P5O75--EP7Aqrn8a7Fg-5rUgQq02w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiP8Kec8GN1wRabagCWasezMXF%3DHA0XBbXKUzswg9cWwPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Template syntax issues w dict

2015-05-01 Thread ADEWALE ADISA
If I can understand your code, of seems you want a table of : Institution |
Number of attendees
So if am right u can achive it this way :

{% for org, num in attendees_per_org.items() %}

{{ org }}
{{ num }}

  {% endfor %}

Since your dataset is a dictionary, u need to use key,value to get elements
in both side. Also items() is also required.
On May 1, 2015 8:22 AM, "Lachlan Musicman"  wrote:

> Hola,
>
> Django shell gives right results, template doesn't: code here
>
> http://dpaste.com/1NJEKD8
>
> What am I doing wrong?
>
> L.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGBeqiN78i37JA9UJov7%2BAVbJzRt4c5YCX3em2XvN-QmefxSvg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMGzuy_WwAKnYddxrYBL5P5O75--EP7Aqrn8a7Fg-5rUgQq02w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.