Problem with For and Forloop

2020-10-31 Thread Bak4nimE Oficial
Hello good, I have a problem using the for and for loop, what I want is that this process is repeated in all pages, so I put it in the base page.html. I want the last added in all pages like, in the blog, login and index. At this moment you can only see it in the index. This is code inside the

Re: django template forloop

2020-10-14 Thread webmbackslash
{% endfor %} >> Immagine >> {% endif %} >> {% if forloop.counter|divisibleby:"2" %} >> >> {% endif %} >> >> The second forloop is not executed, where i have to apply it? >> >> Thanks &g

Re: django template forloop

2020-10-14 Thread RANGA BHARATH JINKA
{% for fieldi in formone %} > {{ fieldi.label }} {{ fieldi }} > {% endfor %} > Immagine > {% endif %} > {% if forloop.counter|divisibleby:"2" %} > > {% endif %} > > The second

django template forloop

2020-10-14 Thread luca72.b...@gmail.com
ter|divisibleby:"2" %} {% endif %} The second forloop is not executed, where i have to apply it? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Bootstrap Tabs not working with Forloop rendered content

2017-04-15 Thread Richard Jackson
I've actually found a workaround, but if anyone has any thoughts on this I'd be interested to hear them! Rich On 15 April 2017 at 21:14, Richard Jackson wrote: > Hi everyone, > > Having a Bootstrap/jQuery with Django issue so hope that someone might be > able to help. > >

Bootstrap Tabs not working with Forloop rendered content

2017-04-15 Thread Richard Jackson
Hi everyone, Having a Bootstrap/jQuery with Django issue so hope that someone might be able to help. I'm rendering a part of my page to make a Bootstrap 'tab' (docs: link here ) - however the content under the first heading isn't

Re: forloop

2015-01-27 Thread sum abiut
>>> won't be true. >>>> >>>> On Mon, Jan 26, 2015 at 5:38 PM, sum abiut <suab...@gmail.com> wrote: >>>> > Thank you for your email. I am iterating all the row to find out >>>> which row >>>> > was recently added. basic

Re: forloop

2015-01-27 Thread sum abiut
;> > Thank you for your email. I am iterating all the row to find out which >>> row >>> > was recently added. basically when a row is added to it become last. >>> so i am >>> > trying to comparing a column on the last row. which is the row that was >>

Re: forloop

2015-01-26 Thread James Schneider
at was >> > recently add if the condition of the column is exist. that is when i >> send >> > out email. >> > >> > hope my explanation is clear. >> > >> > Cheers >> > >> > >> > On Tue, Jan 27, 2015 at 10:28 AM, Paul Royik <

Re: forloop

2015-01-26 Thread sum abiut
am > > trying to comparing a column on the last row. which is the row that was > > recently add if the condition of the column is exist. that is when i send > > out email. > > > > hope my explanation is clear. > > > > Cheers > > > > > > On Tue, Jan 27, 2015 at

Re: forloop

2015-01-26 Thread Stephen J. Butler
:28 AM, Paul Royik <distantjob...@gmail.com> > wrote: >> >> Inside view there is no forloop (unless you explicitly define it). forloop >> is defined only inside for loops in templates >> >> Actually your code is somewhat weird. >> You iterate

Re: forloop

2015-01-26 Thread sum abiut
out email. hope my explanation is clear. Cheers On Tue, Jan 27, 2015 at 10:28 AM, Paul Royik <distantjob...@gmail.com> wrote: > Inside view there is no forloop (unless you explicitly define it). forloop > is defined only inside for loops in templates > > Actually your code

Re: forloop

2015-01-26 Thread Paul Royik
Inside view there is no forloop (unless you explicitly define it). forloop is defined only inside for loops in templates Actually your code is somewhat weird. You iterate all list until last without doing anything. It is more efficient to use slicing email = newleave.objects.all()[-1

forloop

2015-01-26 Thread sum abiut
Hi, i am getting an error as below when iterating throw rows. Basically what i want to do is iterate through number of rows. When on the last row i want to compare a column then send out an email. here is the error that i am getting: global name 'forloop' is not defined here is my view.py

Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-24 Thread Pepsodent Cola
, November 20, 2013 10:29:24 PM UTC+1, Pepsodent Cola wrote: > > 1.) > How do I use mathematical calculations on my forloop Article/Publication > list? > > * I have attached a screenshot with the table field that I'm working on > *"Publicists > coverage (%)"*. &

Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-23 Thread Andre Terra
lications() > > And I followed some tutorial exercises on making Template filters. After > seeing DJ-Tom's hint. > > And this is as far as I got from trying things... > I'm trying to send two lists to my template so I can do some parallel > iteration in my forloop. > But th

Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-23 Thread Pepsodent Cola
in my forloop. But then I realized that *type(articles)* is a Queryset and not a list so I can't use zip() like in the examples I'm reading. So how can I integrate my list *publicists_coverage* = [] # List 3 into this forloop template code? {% for row in *articles

Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-22 Thread DJ-Tom
Am Donnerstag, 21. November 2013 18:53:00 UTC+1 schrieb Pepsodent Cola: > > 1.) > I managed to make my View calculate my variables but I'm getting the same > result *"0.6"* for each forloop. > What am I doing wrong with my variables calculation? > You are p

Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-21 Thread Pepsodent Cola
@James Now I understand what you mean. :) I will work on this some more tonight. On Wednesday, November 20, 2013 10:29:24 PM UTC+1, Pepsodent Cola wrote: > > 1.) > How do I use mathematical calculations on my forloop Article/Publication > list? > > * I have att

Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-21 Thread James Turley
, not the set itself. articles[0].num_publications() would return the number of publications associated with the first article in the set, for example. James On Wed, Nov 20, 2013 at 9:29 PM, Pepsodent Cola <pepsodentc...@gmail.com>wrote: > 1.) > How do I use mathematical calculations on my for

Re: How can I forloop this count() in my template code?

2013-11-20 Thread Pepsodent Cola
Thanks Tom it worked! :) On Wednesday, November 20, 2013 12:18:23 PM UTC+1, Pepsodent Cola wrote: > > How can I forloop this count() in my template code? > > * I have attached my project files that you might run and see for > yourselves. > * I have attached a screenshot of the

Re: How can I forloop this count() in my template code?

2013-11-20 Thread Tom Evans
On Wed, Nov 20, 2013 at 11:18 AM, Pepsodent Cola <pepsodentc...@gmail.com> wrote: > How can I forloop this count() in my template code? > > * I have attached my project files that you might run and see for > yourselves. > * I have attached a screenshot of the table I'm work

Re: forloop breaking

2013-06-27 Thread abhijeet shete
Hi, You can achieve this by using javascript or jquery. Just check this example : http://jsfiddle.net/pxbW9/ I want to remove the static heading of a table in django templates in > which the data is coming form database which is dynamic so I want if > there is no entry in that column it

Re: forloop breaking

2013-06-27 Thread Harjot Mann
On Thu, Jun 27, 2013 at 11:40 AM, yati sagade wrote: > I doubt she has a problem with the Python for-loop. She is trying to achieve > similar control flow in the Django templating language's for loop. I want to remove the static heading of a table in django templates in

Re: forloop breaking

2013-06-27 Thread yati sagade
w.html#break-and-continue-statements-and-else-clauses-on-loops > > > 2013/6/27 vijay shanker <deont...@gmail.com> > >> You are looking for "break" >> >> On Wednesday, June 26, 2013 8:39:58 PM UTC+5:30, Harjot Mann wrote: >>> >>> Wh

Re: forloop breaking

2013-06-26 Thread Gladson Simplício Brito
gt;> What are the methods to break forloop? >> > -- > 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...@g

Re: forloop breaking

2013-06-26 Thread vijay shanker
You are looking for "break" On Wednesday, June 26, 2013 8:39:58 PM UTC+5:30, Harjot Mann wrote: > > What are the methods to break forloop? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: forloop breaking

2013-06-26 Thread yati sagade
The best thing I can think of is to send from the view a set/list of available attributes such that there is at least one item with a non empty value for those attributes. This can be achieved by a single iteration on the iterable `st'. Then in the template, you can just check if, for example

Re: forloop breaking

2013-06-26 Thread Harjot Mann
Actually I want to remove the heading of my table in templates if it is not filled. I have done this using this coding: {% for test in st|slice:":1" %}S.No {% ifnotequal test.Description "" %} Description{% endifnotequal %} {% ifnotequal test.Thickness "" %}Thickness{% endifnotequal %}

Re: forloop breaking

2013-06-26 Thread Jonathan Baker
r foo in bar: > if foo == 1: > do something even redirect > else: > foo > > > On Wednesday, June 26, 2013 5:09:58 PM UTC+2, Harjot Mann wrote: >> >> What are the methods to break forloop? >> > -- > You received thi

Re: forloop breaking

2013-06-26 Thread Goran
You can always use IF for foo in bar: if foo == 1: do something even redirect else: foo On Wednesday, June 26, 2013 5:09:58 PM UTC+2, Harjot Mann wrote: > > What are the methods to break forloop? > -- You received this message be

forloop breaking

2013-06-26 Thread Harjot Mann
What are the methods to break forloop? -- 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 g

Re: How to get next and previous element in a forloop in the template

2011-03-10 Thread Derek
r...@gmail.com> wrote: > > Hi everybody: > > > I would want to know in the django template tags how to get the next and > > the previous element when I am iterating in the forloop, I haven't found > > something similar, for instance I would want something like this:

Re: How to get next and previous element in a forloop in the template

2011-03-08 Thread Bill Freeman
;> >> Hi everybody: >> >> I would want to know in the django template tags how to get the next and >> the previous element when I am iterating in the forloop, I haven't found >> something similar, for instance I would want something like this: >>

Re: How to get next and previous element in a forloop in the template

2011-03-07 Thread Ariel
to get the next and > the previous element when I am iterating in the forloop, I haven't found > something similar, for instance I would want something like this: > > {% for element in list_elements %} > {{forloop.get_prev_element.title}} > {{forloop.get_next_element.title}} > -- Y

How to get next and previous element in a forloop in the template

2011-03-07 Thread Ariel
Hi everybody: I would want to know in the django template tags how to get the next and the previous element when I am iterating in the forloop, I haven't found something similar, for instance I would want something like this: {% for element in list_elements %} {{forloop.get_prev_element.title

Re: Using forloop counter to index into a query set

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 08:05 -0700, SnappyDjangoUser wrote: > Hi Malcolm, > > You suggested: > > > set up the data structures > > you pass to your view a bit differently so that you can loop over the > > forms and the products simultaneously (that is, pull apart the formset > > forms and zip

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
mostly used for printing the iteration through the > > > loop (not for indexing) and the "for loop" tag in Django is built only > > > to iterate through one structure at a time.  Do you have any examples > > > how how to loop through 2 strucutres simultaneously

Re: Using forloop counter to index into a query set

2008-09-30 Thread felix
t only > > > to iterate through one structure at a time.  Do you have any examples > > > how how to loop through 2 strucutres simultaneously? > > > > Thanks! > > > > -Brian > > > > On Sep 30, 12:10 am, Malcolm Tredinnick <[EMAIL PROTECTED]> >

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
.  Do you have any examples > > how how to loop through 2 strucutres simultaneously? > > > Thanks! > > > -Brian > > > On Sep 30, 12:10 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > > wrote: > > > > On Mon, 2008-09-29 at 17:31 -0700, SnappyDjango

Re: Using forloop counter to index into a query set

2008-09-30 Thread felix
p" tag in Django is built only > to iterate through one structure at a time.  Do you have any examples > how how to loop through 2 strucutres simultaneously? > > Thanks! > > -Brian > > On Sep 30, 12:10 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > >

Re: Using forloop counter to index into a query set

2008-09-30 Thread Carl Meyer
On Sep 30, 11:05 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > > set up the data structures > > you pass to your view a bit differently so that you can loop over the > > forms and the products simultaneously (that is, pull apart the formset > > forms and zip them together with the product

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
1 -0700, SnappyDjangoUser wrote: > > Hi Folks, > > > How can I use a forloop counter to index into a query set as in the > > example below? > > > (I know this code does not work, but I want to do something of the > > sort): > > > {% for form in quote_produ

Re: Using forloop counter to index into a query set

2008-09-30 Thread Malcolm Tredinnick
On Mon, 2008-09-29 at 17:31 -0700, SnappyDjangoUser wrote: > Hi Folks, > > How can I use a forloop counter to index into a query set as in the > example below? > > (I know this code does not work, but I want to do something of the > sort): > > {% for form in

Re: Using forloop counter to index into a query set

2008-09-29 Thread SnappyDjangoUser
it might be easiest to write a custom tag there > > {% vendor_of_product product forloop.counter %} > > is product an array ? > > On Sep 30, 2:31 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > > > Hi Folks, > > > How can I use a forloop counter to index into a q

Re: Using forloop counter to index into a query set

2008-09-29 Thread felix
it might be easiest to write a custom tag there {% vendor_of_product product forloop.counter %} is product an array ? On Sep 30, 2:31 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > Hi Folks, > > How can I use a forloop counter to index into a query set as in the > exa

Using forloop counter to index into a query set

2008-09-29 Thread SnappyDjangoUser
Hi Folks, How can I use a forloop counter to index into a query set as in the example below? (I know this code does not work, but I want to do something of the sort): {% for form in quote_product_formset.forms %} {{ product.(forloop.counter).Vendor }} {{ form

Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-23 Thread sotirac
Hi Steve, the cycle tag fixed the issue. Thanks. On Sep 15, 1:00 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Lee Hinde wrote: > > > On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED] > > > wrote: > > >     In the django template where I am using a for loop,

Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-15 Thread Steve Holden
Lee Hinde wrote: > > > On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED] > > wrote: > > > In the django template where I am using a for loop, I have to use a > special tag (div class="yui-u first" instead of div class="yui") for > every forth

Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-15 Thread sotirac
Thank you. I'll test this out. I also found the "cycle" tag which looks very promising. On Sep 15, 1:05 am, "Lee Hinde" <[EMAIL PROTECTED]> wrote: > On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]> wrote: > > > In the django template where I am using a for loop, I have to use a >

Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-14 Thread Lee Hinde
On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]> wrote: > > In the django template where I am using a for loop, I have to use a > special tag (div class="yui-u first" instead of div class="yui") for > every forth item. Im trying to create a table with three columns. I > can access

using forloop variable to get the provide special tags for the 4th element.

2008-09-14 Thread sotirac
In the django template where I am using a for loop, I have to use a special tag (div class="yui-u first" instead of div class="yui") for every forth item. Im trying to create a table with three columns. I can access the first loop but how do I do it for every third. -- {% extends

Re: templates: additional forloop variable?

2008-07-14 Thread Scott Moonen
(Tim - thanks for the suggestion.) Russ, I'm considering adding a forloop.previous (or somesuch) variable to the >> supplemental variables produced by the for tag. If forloop.first is true, >> this value would always be None, but otherwise it would reference the >> actual >> loop item from the

Re: templates: additional forloop variable?

2008-07-14 Thread Russell Keith-Magee
On Mon, Jul 14, 2008 at 7:46 AM, Scott Moonen <[EMAIL PROTECTED]> wrote: > I'm considering adding a forloop.previous (or somesuch) variable to the > supplemental variables produced by the for tag. If forloop.first is true, > this value would always be None, but otherwise it would reference the

Re: templates: additional forloop variable?

2008-07-13 Thread Tim Chase
> I'm considering adding a forloop.previous (or somesuch) > variable to the supplemental variables produced by the for > tag. If forloop.first is true, this value would always be > None, but otherwise it would reference the actual loop item > from the prior iteration. I'd be tempted to do it

templates: additional forloop variable?

2008-07-13 Thread Scott Moonen
Within a Django template, sometimes I find myself wishing that I had access to the loop item from the previous iteration of a loop. Usually the ifchanged tag is good enough for my purposes, but occasionally if some attribute of the loop item has changed I need to do further examination of the

Re: Passing a variable to forloop

2008-04-30 Thread Jay
I'm working with a paginator templatetag, and I'm > > > > trying to apply a custom style to the current page. > > > > > In the code below, page.number renders *outside* the forloop, but > > > > not *inside* the forloop. > > > > > {{ page.number }} << t

Re: Passing a variable to forloop

2008-04-30 Thread Lucas Hazel
te: > > On Wed, 30 Apr 2008 17:21:47 -0700 (PDT) > > > > > > > > Jay <[EMAIL PROTECTED]> wrote: > > > > > Hi, guys.  I'm working with a paginator templatetag, and I'm > > > trying to apply a custom style to the current page. > > >

Re: Passing a variable to forloop

2008-04-30 Thread Jay
gt; > > Hi, guys.  I'm working with a paginator templatetag, and I'm trying to > > apply a custom style to the current page. > > > In the code below, page.number renders *outside* the forloop, but not > > *inside* the forloop. > > > {{ page.number }} <<

Re: Passing a variable to forloop

2008-04-30 Thread Lucas Hazel
On Wed, 30 Apr 2008 17:21:47 -0700 (PDT) Jay <[EMAIL PROTECTED]> wrote: > > Hi, guys. I'm working with a paginator templatetag, and I'm trying to > apply a custom style to the current page. > > In the code below, page.number renders *outside* the forloop, but not &

Passing a variable to forloop

2008-04-30 Thread Jay
Hi, guys. I'm working with a paginator templatetag, and I'm trying to apply a custom style to the current page. In the code below, page.number renders *outside* the forloop, but not *inside* the forloop. {{ page.number }} << this one renders, but the next page.number does not. {% fo

Re: template & forloop help

2008-02-08 Thread Marcin Mierzejewski
Hi, What is 'divs' in your example? And what do you want to do it? If you want to display a list "name1", "name2", "name3" you can do it in this way: view.py divs = ('name1', 'name2', 'name3') template.html {% for div in divs %} {{ div }} {% endfor %} Regards, Marcin On Feb 6, 5:23 pm,

Re: template & forloop help

2008-02-08 Thread David Reynolds
On 6 Feb 2008, at 4:23 pm, [EMAIL PROTECTED] wrote: > > Hi guys, > > Trying to figure out how to use the forloop.counter in a template but > to add it to a field to increment the name of the field each time. for > example.. in my template i will have this > > {% for div in divs %} > {{

template & forloop help

2008-02-06 Thread leahy_rich
Hi guys, Trying to figure out how to use the forloop.counter in a template but to add it to a field to increment the name of the field each time. for example.. in my template i will have this {% for div in divs %} {{ form.name }} {% endfor %} so this will result in ... name name name etc.. I

How to do a recursive inclusion forloop in a django template

2007-09-02 Thread Arik Jones
I have a pages model that has a recursive relationship to itself. Lets say I list only pages that are root parents. In my forloop, how do I display with each root parent page all its children, including children of children as well? Your help and input is greatly appreciated. Thank you

Re: forloop variables without for

2007-07-19 Thread sean
Glad to help. {{ images.image_set.count }} or similar should work, depending on your models. cheers, Sean On Jul 20, 1:13 am, Marc Garcia <[EMAIL PROTECTED]> wrote: > Thanks mate, it works great. > > Anybody could tell me if there is something like that for counting > items on that? > > Don't

Re: forloop variables without for

2007-07-19 Thread Marc Garcia
Thanks mate, it works great. Anybody could tell me if there is something like that for counting items on that? Don't want to do: {% for image in images %} {% if forloop.last %} {{ forloop.counter }} {% endif %} {% endfor %} On Jul 19, 7:51 pm, sean <[EMAIL

Re: forloop variables without for

2007-07-19 Thread sean
Try {{ images.0.image }} Sean On Jul 19, 7:43 pm, Marc Garcia <[EMAIL PROTECTED]> wrote: > Hi! > > In a project I get a set of images from a model, and then I display it > on the template. In same template (but in another place), I just want > to display first element of set, and number of

forloop variables without for

2007-07-19 Thread Marc Garcia
Hi! In a project I get a set of images from a model, and then I display it on the template. In same template (but in another place), I just want to display first element of set, and number of objects given. Can I do it without adding those fields to views.py? I've found a way for doing first,

Re: How does the forloop really work?

2006-11-15 Thread Kamil Wdowicz
ticles displayed in different parts of a web > > page. The latest article in specific , the next 2 in another and > > rest of it somewhere down inside the same page. > > > > > > > > I am not able to figure out how? My guess is forloop, but how? > > > > > &g

Re: How does the forloop really work?

2006-11-14 Thread Ramdas S
trying to get a list of articles displayed in different parts of a web> page. The latest article in specific , the next 2 in another and > rest of it somewhere down inside the same page.>>>> I am not able to figure out how? My guess is forloop, but how?>>

Re: How does the forloop really work?

2006-11-14 Thread Julio Nobrega
down inside the same page. > > > > I am not able to figure out how? My guess is forloop, but how? > > > Thanks > > Keith > > > > -- Julio Nobrega - http://www.inerciasensorial.com.br --~--~-~--~~~---~--~~ You received