s/Podcast/Cast/g
This commit is contained in:
parent
834470b587
commit
a6ffa087b2
4 changed files with 16 additions and 16 deletions
|
@ -17,14 +17,14 @@
|
||||||
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
|
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from models import PodcastTag, Podcast
|
from models import CastTag, Cast
|
||||||
|
|
||||||
class PodcastTagAdmin(admin.ModelAdmin):
|
class CastTagAdmin(admin.ModelAdmin):
|
||||||
prepopulated_fields = {'slug': ('label',)}
|
prepopulated_fields = {'slug': ('label',)}
|
||||||
|
|
||||||
admin.site.register(PodcastTag, PodcastTagAdmin)
|
admin.site.register(CastTag, CastTagAdmin)
|
||||||
|
|
||||||
class PodcastAdmin(admin.ModelAdmin):
|
class CastAdmin(admin.ModelAdmin):
|
||||||
list_display = ('pub_date', 'title')
|
list_display = ('pub_date', 'title')
|
||||||
list_filter = ['pub_date']
|
list_filter = ['pub_date']
|
||||||
date_hierarchy = 'pub_date'
|
date_hierarchy = 'pub_date'
|
||||||
|
@ -33,4 +33,4 @@ class PodcastAdmin(admin.ModelAdmin):
|
||||||
filter_horizontal = ('tags',)
|
filter_horizontal = ('tags',)
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Podcast, PodcastAdmin)
|
admin.site.register(Cast, CastAdmin)
|
||||||
|
|
|
@ -21,7 +21,7 @@ from django.conf import settings
|
||||||
from apps.staff.models import Person
|
from apps.staff.models import Person
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
class PodcastTag(models.Model):
|
class CastTag(models.Model):
|
||||||
"""Tagging for podcasts"""
|
"""Tagging for podcasts"""
|
||||||
|
|
||||||
label = models.CharField(max_length=100)
|
label = models.CharField(max_length=100)
|
||||||
|
@ -36,8 +36,8 @@ class PodcastTag(models.Model):
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return u"/podcast/?tag=%s" % self.slug
|
return u"/podcast/?tag=%s" % self.slug
|
||||||
|
|
||||||
class Podcast(models.Model):
|
class Cast(models.Model):
|
||||||
"""Podcast"""
|
"""Cast"""
|
||||||
|
|
||||||
title = models.CharField(max_length=200)
|
title = models.CharField(max_length=200)
|
||||||
slug = models.SlugField(unique=True)
|
slug = models.SlugField(unique=True)
|
||||||
|
@ -45,7 +45,7 @@ class Podcast(models.Model):
|
||||||
body = models.TextField(help_text="Use raw HTML. Include the full body of any show notes or other information about this episode. It will be labelled on the site as Show Notes. It is included on the detail entry, and in the description data on the podcast RSS feed.")
|
body = models.TextField(help_text="Use raw HTML. Include the full body of any show notes or other information about this episode. It will be labelled on the site as Show Notes. It is included on the detail entry, and in the description data on the podcast RSS feed.")
|
||||||
pub_date = models.DateTimeField()
|
pub_date = models.DateTimeField()
|
||||||
poster = models.ForeignKey(Person)
|
poster = models.ForeignKey(Person)
|
||||||
tags = models.ManyToManyField(PodcastTag, null=True, blank=True)
|
tags = models.ManyToManyField(CastTag, null=True, blank=True)
|
||||||
ogg_path = models.CharField(max_length=300, blank=True,
|
ogg_path = models.CharField(max_length=300, blank=True,
|
||||||
help_text="Local filename of the Ogg file, relative to webroot. File should be uploaded into the static media area for podcasts.")
|
help_text="Local filename of the Ogg file, relative to webroot. File should be uploaded into the static media area for podcasts.")
|
||||||
mp3_path = models.CharField(max_length=300, blank=True,
|
mp3_path = models.CharField(max_length=300, blank=True,
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
|
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
from models import Podcast, PodcastTag # relative import
|
from models import Cast, CastTag # relative import
|
||||||
from apps.staff.models import Person
|
from apps.staff.models import Person
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
extra_context = {}
|
extra_context = {}
|
||||||
|
|
||||||
info_dict = {
|
info_dict = {
|
||||||
'queryset': Podcast.objects.all(),
|
'queryset': Cast.objects.all(),
|
||||||
'date_field': 'pub_date',
|
'date_field': 'pub_date',
|
||||||
'extra_context': extra_context,
|
'extra_context': extra_context,
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ def all_tags_by_use_amount():
|
||||||
# tally use amount
|
# tally use amount
|
||||||
retval = []
|
retval = []
|
||||||
current = None
|
current = None
|
||||||
for obj in PodcastTag.objects.filter(podcast__pub_date__lte=datetime.now(),
|
for obj in CastTag.objects.filter(podcast__pub_date__lte=datetime.now(),
|
||||||
podcast__isnull=False).order_by('label'):
|
podcast__isnull=False).order_by('label'):
|
||||||
if current is not None and obj.id == current.id:
|
if current is not None and obj.id == current.id:
|
||||||
current.cnt += 1
|
current.cnt += 1
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
# along with this program in a file in the toplevel directory called
|
# along with this program in a file in the toplevel directory called
|
||||||
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
|
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
from models import Podcast, PodcastTag # relative import
|
from models import Cast, CastTag # relative import
|
||||||
from django.views.generic.list_detail import object_list
|
from django.views.generic.list_detail import object_list
|
||||||
from apps.staff.models import Person
|
from apps.staff.models import Person
|
||||||
from django.shortcuts import get_object_or_404, render_to_response
|
from django.shortcuts import get_object_or_404, render_to_response
|
||||||
|
@ -31,7 +31,7 @@ def last_name(person):
|
||||||
return person.formal_name.rpartition(' ')[2]
|
return person.formal_name.rpartition(' ')[2]
|
||||||
|
|
||||||
def custom_index(request, queryset, *args, **kwargs):
|
def custom_index(request, queryset, *args, **kwargs):
|
||||||
"""Podcast list view that allows scrolling and also shows an index by
|
"""Cast list view that allows scrolling and also shows an index by
|
||||||
year.
|
year.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ def custom_index(request, queryset, *args, **kwargs):
|
||||||
|
|
||||||
tags = []
|
tags = []
|
||||||
if 'tag' in request.GET:
|
if 'tag' in request.GET:
|
||||||
tags = [get_object_or_404(PodcastTag, slug=tag)
|
tags = [get_object_or_404(CastTag, slug=tag)
|
||||||
for tag in request.GET.getlist('tag')]
|
for tag in request.GET.getlist('tag')]
|
||||||
extra_context['tags'] = tags
|
extra_context['tags'] = tags
|
||||||
queryset = queryset.filter(OR_filter('tags', tags))
|
queryset = queryset.filter(OR_filter('tags', tags))
|
||||||
|
@ -92,7 +92,7 @@ def query(request):
|
||||||
return relative_redirect(request, '%s%s%s' % (base_url, '?' if query_string else '', query_string))
|
return relative_redirect(request, '%s%s%s' % (base_url, '?' if query_string else '', query_string))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
tags = PodcastTag.objects.all().order_by('label')
|
tags = CastTag.objects.all().order_by('label')
|
||||||
return render_to_response('podcast/query.html', {'tags': tags})
|
return render_to_response('podcast/query.html', {'tags': tags})
|
||||||
|
|
||||||
def relative_redirect(request, path):
|
def relative_redirect(request, path):
|
||||||
|
|
Loading…
Reference in a new issue