@@ -18,49 +18,49 @@
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.syndication.views import Feed
from django.views.generic.dates import DateDetailView, DayArchiveView, MonthArchiveView, YearArchiveView
from . import frontpage
from .feeds import feed_dict, view, Mp3CastFeed, OggCastFeed
from .models import Cast, CastTag
from .views import custom_index, query
app_name = 'podjango'
extra_context = {}
info_dict = {
'queryset': Cast.objects.all(),
'date_field': 'pub_date',
'extra_context': extra_context,
'template_name': 'podjango/cast/cast_detail.html',
}
urlpatterns = [
url(r'^$', frontpage.view),
url(r'^$', frontpage.view, name='cast-home'),
url(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view(**info_dict), name='detail'),
url(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', DayArchiveView.as_view(**info_dict), name='day-archive'),
url(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', MonthArchiveView.as_view(**info_dict), name='month-archive'),
url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(**info_dict), name='year-archive'),
url(r'^all/$', custom_index, dict(info_dict, paginate_by=20), name='cast'),
url(r'^query/$', query, name='query'),
url(r'^feeds/cast-ogg/$', OggCastFeed(), name='feed-ogg'),
url(r'^feeds/cast-mp3/$', Mp3CastFeed(), name='feed-mp3'),
url(r'^feeds/$', view, name='feeds'),
]
if settings.DEBUG:
from django.conf.urls.static import static
urlpatterns += static('/', document_root='podjango/static')
def all_tags_by_use_amount():
"""Returns all tags with an added 'cnt' attribute (how many times used)
Also sorts the tags so most-used tags appear first.
"""
# tally use amount
retval = []
current = None