Peter is right, use the last snippet just if you feel the need.
On Jan 9, 2008 11:07 AM, Peter Rowell <[EMAIL PROTECTED]> wrote:
>
> On Jan 9, 12:20 am, Gaojiawang <[EMAIL PROTECTED]> wrote:
> > I want to use the local variable in template's html file.
> > like 'count = 0' and how to use it
> > Ho
On Jan 9, 12:20 am, Gaojiawang <[EMAIL PROTECTED]> wrote:
> I want to use the local variable in template's html file.
> like 'count = 0' and how to use it
> How to do it?
The snippet José links to uses the resolve function of Django's
templating system, which is good because it stays within the c
I had just made a template tag to do exactly what you are looking for:
"assign a variable or make a variable in a template", here is the link
to see the code in djangosnippets:
http://www.djangosnippets.org/snippets/539/
I hope this will help.
On Jan 9, 2008 6:04 AM, [EMAIL PROTECTED] <[EMAIL PR
Sorry, i'm in the habit of using tabs to indent code, so I pressed tab
while editing that sinippet, then hit enter, which ended up sending
the message.
Anyways, you could som something like:
{% for o in some_list %}
{% cycle '/' '/' '/' '' %}
{% endfor %}
That should print a newline
You could use the "cycle" template tag (Documentation).
If your separator for a single row was a slash, you could do something
like
{% for o in some_list %}
{% cycle '' 'row2' rowvar %}
...
{% endfor %}
--~--~-~--~~~---~--~~
You received this mes
I have no idea what you are doing exactly...maybe this helps:
http://www.djangoproject.com/documentation/templates/#cycle
Perhaps provide an example of your query set and what you want it the final
output to look like.
Dave
On Jan 9, 2008 12:52 AM, Gaojiawang <[EMAIL PROTECTED]> wrote:
>
> Hi,
Hi,
Thanks your reply.
I get an assemblly data and want to show in the template.
How to show four result in one row?
I have no idea about this.
Thanks and regards.
On Jan 9, 4:24 pm, "David Grant" <[EMAIL PROTECTED]> wrote:
> I'm pretty sure you can't do that.
>
> http://www.djangobook.com/en/
I'm pretty sure you can't do that.
http://www.djangobook.com/en/1.0/chapter04/ (see "Philosophies and
Limitations")
also, http://www.djangoproject.com/documentation/
Dave
On Jan 9, 2008 12:20 AM, Gaojiawang <[EMAIL PROTECTED]> wrote:
>
> Hi,all
> I want to use the local variable in template's
Hi,all
I want to use the local variable in template's html file.
like 'count = 0' and how to use it
{% ifequal count%4 0%}
do something
{% endifequal%}
But Do not pass.
How to do it?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
9 matches
Mail list logo