mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00

Each module now contains a struct.py file that will return all the URLs that it can generate (yes, this is a small break of the abstraction of url.py, but we've broken that elsewhere as well), and also which search-engine-weight (0.1-1.0) that this URL should be given.
15 lines
343 B
Python
15 lines
343 B
Python
import os
|
|
from datetime import date
|
|
from models import PwnPost
|
|
|
|
def get_struct():
|
|
now = date.today()
|
|
|
|
yield ('community/weeklynews/', None)
|
|
for p in PwnPost.objects.all():
|
|
yearsold = (now - p.date).days / 365
|
|
if yearsold > 4:
|
|
yearsold = 4
|
|
yield ('community/weeklynews/pwn%s' % p.date.strftime("%Y%m%d"),
|
|
0.5-(yearsold/10.0))
|