Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} 

And if you want to stick with two lists, then you should have a glance at this questionthis question.

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} 

And if you want to stick with two lists, then you should have a glance at this question.

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} 

And if you want to stick with two lists, then you should have a glance at this question.

added 198 characters in body
Source Link
Allactaga
  • 193
  • 1
  • 7

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} 

And if you want to stick with two lists, then you should have a glance at this question.

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} 

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} 

And if you want to stick with two lists, then you should have a glance at this question.

Source Link
Allactaga
  • 193
  • 1
  • 7

How about trying something like that?

from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... 

Then template would be:

{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %}