s/Podcast/Cast/g

This commit is contained in:
Bradley M. Kuhn 2010-10-05 15:13:30 -04:00
parent 834470b587
commit a6ffa087b2
4 changed files with 16 additions and 16 deletions

View file

@ -17,14 +17,14 @@
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
#
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',)}
admin.site.register(PodcastTag, PodcastTagAdmin)
admin.site.register(CastTag, CastTagAdmin)
class PodcastAdmin(admin.ModelAdmin):
class CastAdmin(admin.ModelAdmin):
list_display = ('pub_date', 'title')
list_filter = ['pub_date']
date_hierarchy = 'pub_date'
@ -33,4 +33,4 @@ class PodcastAdmin(admin.ModelAdmin):
filter_horizontal = ('tags',)
admin.site.register(Podcast, PodcastAdmin)
admin.site.register(Cast, CastAdmin)

View file

@ -21,7 +21,7 @@ from django.conf import settings
from apps.staff.models import Person
from datetime import datetime, timedelta
class PodcastTag(models.Model):
class CastTag(models.Model):
"""Tagging for podcasts"""
label = models.CharField(max_length=100)
@ -36,8 +36,8 @@ class PodcastTag(models.Model):
def get_absolute_url(self):
return u"/podcast/?tag=%s" % self.slug
class Podcast(models.Model):
"""Podcast"""
class Cast(models.Model):
"""Cast"""
title = models.CharField(max_length=200)
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.")
pub_date = models.DateTimeField()
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,
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,

View file

@ -17,14 +17,14 @@
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
#
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 datetime import datetime
extra_context = {}
info_dict = {
'queryset': Podcast.objects.all(),
'queryset': Cast.objects.all(),
'date_field': 'pub_date',
'extra_context': extra_context,
}
@ -55,7 +55,7 @@ def all_tags_by_use_amount():
# tally use amount
retval = []
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'):
if current is not None and obj.id == current.id:
current.cnt += 1

View file

@ -16,7 +16,7 @@
# along with this program in a file in the toplevel directory called
# "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 apps.staff.models import Person
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]
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.
"""
@ -54,7 +54,7 @@ def custom_index(request, queryset, *args, **kwargs):
tags = []
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')]
extra_context['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))
else:
tags = PodcastTag.objects.all().order_by('label')
tags = CastTag.objects.all().order_by('label')
return render_to_response('podcast/query.html', {'tags': tags})
def relative_redirect(request, path):