1 from datetime
import date
, timedelta
2 from .models
import NewsArticle
7 fouryearsago
= date
.today() - timedelta(4 * 365, 0, 0)
9 # We intentionally don't put /about/newsarchive/ in the sitemap,
10 # since we don't care about getting it indexed.
11 # Also, don't bother indexing anything > 4 years old
13 for n
in NewsArticle
.objects
.filter(approved
=True, date__gt
=fouryearsago
):
14 yearsold
= (now
- n
.date
).days
/ 365
17 yield ('about/news/%s/' % n
.id,
18 0.5 - (yearsold
/ 10.0))