1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-22 20:44:55 +00:00

pyi2phosts/urls.py: use callable to get external sources

Needed for prevent queryset caching.
http://docs.djangoproject.com/en/1.2/topics/generic-views/#adding-extra-context
This commit is contained in:
Hidden Z 2010-11-06 16:06:23 +00:00
parent cff54ef2be
commit 82b77b8b51

View File

@ -9,6 +9,9 @@ from pyi2phosts.lib.utils import get_b32
from pyi2phosts.extsources.models import ExternalSource
import settings
def get_extsources():
return ExternalSource.objects.filter(active=True)
urlpatterns = patterns('',
url(r'^$', direct_to_template, {
'template': 'index.html',
@ -23,7 +26,7 @@ urlpatterns = patterns('',
'template': 'faq.html',
'extra_context': {
'title': settings.SITE_NAME,
'sources': ExternalSource.objects.filter(active=True)
'sources': get_extsources
}
}, name='faq'),
(r'^postkey/', include('pyi2phosts.postkey.urls')),