On Mon, Jun 18, 2007 at 03:44:03PM +0200, Aidas Bendoraitis wrote:
>
> Hello Trey!
>
> You can iterate by the entries of a dictionary, using this:
>
> {% for i in d.items %}
> {{ i.0 }}: {{ i.1 }}
> {% endfor %}
>
> Regards,
> Aidas Bendoraitis aka Archatas
>
>
>
> On 6/7/07, Trey <[EMAIL
Hello Trey!
You can iterate by the entries of a dictionary, using this:
{% for i in d.items %}
{{ i.0 }}: {{ i.1 }}
{% endfor %}
Regards,
Aidas Bendoraitis aka Archatas
On 6/7/07, Trey <[EMAIL PROTECTED]> wrote:
>
> Thanks Russ, I think my answer for today is three dimensional lists...
> Ho
Thanks Russ, I think my answer for today is three dimensional lists...
Hooray for complex datastructures :)
Tim, that's a very cool idea. I will research this some and see if I
can abstract the calendar control.
On Jun 7, 11:02 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> > Somehow I doubt this sh
> Somehow I doubt this should really be in the view either. Maybe it's
> just one of those out liers that doesn't have a good place.
Sounds like you're describing template tags. They're ways of
creating reusable bits you can just drop into your templates to
abstract away the logic required to
On 6/7/07, Trey <[EMAIL PROTECTED]> wrote:
>
> I thought that something like that was the answer.
>
> Normally I would agree but I can't think of another way to make a
> calendar style layout with certain events on it. Check out my glorious
> hack and tell me what you think.
My eyes! They burn! :
I thought that something like that was the answer.
Normally I would agree but I can't think of another way to make a
calendar style layout with certain events on it. Check out my glorious
hack and tell me what you think.
c is a matrix from the calendar object.
import calendar
calendar.
On 6/7/07, Trey <[EMAIL PROTECTED]> wrote:
>
> The first line, dict.1 works fine. But when I try to use the d
> variable for the dict index it doesn't work. Is there a way to
> accomplish this?
No, by design. We have explicitly tried to avoid making the django
template language a programming lang
That wasn't exactly the example as it was written. Let me try to
clarify.
w is simply a list of numbers.
w = [1,2,3,4,5,6,7,]
Take this dict.
dict = {1: 10, 2: 10, 19: 0, 29: 0, 30: 10}
{% for x in w %}
{{dict.1}}
{{dict.x}}
{% endfor %}
--~--~-~--~~~---~--
w : {1: 10, 2: 10, 19: 0, 29: 0, 30: 10}
{% for d in w %}
{{d.1}}
{{d.2}}
{% endfor %}
d ISN'T an interation of a loop incrementing. It's interating THROUGH
w. So d is one element of w each iteration
list : {'a','b','c','d'}
{% for item in list %}
{{item}}
{% endfor %}
a
b
c
d
If your com
I have a simple problem that I am not quite sure why it won't work.
Take this dict.
{1: 10, 2: 10, 19: 0, 29: 0, 30: 10}
w is simply a list of numbers
{% for d in w %}
{{dict.1}}
{{dict.d}}
{% endfor %}
The first line, dict.1 works fine. But when I try to use the d
variable for the dict in
10 matches
Mail list logo