Skip to content

Commit

Permalink
change VideoCast to Videocast
Browse files Browse the repository at this point in the history
  • Loading branch information
mavenium committed Jan 5, 2021
1 parent ec7b964 commit e52a954
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions content/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class VideoAdmin(admin.ModelAdmin):
list_editable = ('publish',)
list_filter = ('publish', 'category',)
search_fields = ('title',)
models.VideoCast.display_category.short_description = _('Categories')
models.Videocast.display_category.short_description = _('Categories')
prepopulated_fields = {'slug': ('title',)}


Expand All @@ -33,8 +33,8 @@ class PodcastAdmin(admin.ModelAdmin):

admin.site.register(models.BlogCategory)
admin.site.register(models.Blog, BlogAdmin)
admin.site.register(models.VideoCastCategory)
admin.site.register(models.VideoCast, VideoAdmin)
admin.site.register(models.VideocastCategory)
admin.site.register(models.Videocast, VideoAdmin)
admin.site.register(models.Podcast, PodcastAdmin)
admin.site.register(models.PodcastCategory)
admin.site.register(models.Skill)
2 changes: 1 addition & 1 deletion content/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def show_system_content(request):
return {
'blog_categories': models.BlogCategory.objects.all(),
'video_cast_categories': models.VideoCastCategory.objects.all(),
'video_cast_categories': models.VideocastCategory.objects.all(),
'podcast_categories': models.PodcastCategory.objects.all(),
'podcasts': models.Podcast.objects.order_by('-pk').filter(publish=True)[:2],
'config': config
Expand Down
6 changes: 3 additions & 3 deletions content/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __str__(self):
return self.title


class VideoCastCategory(models.Model):
class VideocastCategory(models.Model):
title = models.CharField(
max_length=256,
verbose_name=_('Title :'),
Expand All @@ -78,7 +78,7 @@ def __str__(self):
return self.title


class VideoCast(models.Model):
class Videocast(models.Model):
title = models.CharField(
max_length=256,
verbose_name=_('Title :'),
Expand Down Expand Up @@ -107,7 +107,7 @@ class VideoCast(models.Model):
verbose_name=_('Video link :')
)
category = models.ManyToManyField(
VideoCastCategory
VideocastCategory
)
content = RichTextUploadingField()

Expand Down
10 changes: 5 additions & 5 deletions content/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
path('create/blog_category/', views.BlogCategoryCreateView.as_view(), name='blog_category_create'),
path('blog/<int:pk>/', views.BlogArchiveByCategoryPK.as_view(), name='blog_archive_by_category_pk'),
path('blog/<str:slug>/', views.BlogSingle.as_view(), name='blog_single'),
path('create/video_cast_category/', views.VideoCastCategoryCreateView.as_view(), name='video_cast_category_create'),
path('video_cast/', views.VideoCast.as_view(), name='video_cast'),
path('create/video_cast/', views.VideoCastCreateView.as_view(), name='video_cast_create'),
path('video_cast/<int:pk>/', views.VideoCastArchiveByCategoryPK.as_view(), name='video_cast_archive_by_category_pk'),
path('video_cast/<str:slug>/', views.VideoCastSingle.as_view(), name='video_cast_single'),
path('create/video_cast_category/', views.VideocastCategoryCreateView.as_view(), name='video_cast_category_create'),
path('video_cast/', views.Videocast.as_view(), name='video_cast'),
path('create/video_cast/', views.VideocastCreateView.as_view(), name='video_cast_create'),
path('video_cast/<int:pk>/', views.VideocastArchiveByCategoryPK.as_view(), name='video_cast_archive_by_category_pk'),
path('video_cast/<str:slug>/', views.VideocastSingle.as_view(), name='video_cast_single'),
path('create/podcast_category/', views.PodcastCategoryCreateView.as_view(), name='podcast_category_create'),
path('podcast/', views.Podcast.as_view(), name='podcast'),
path('create/podcast/', views.PodcastCreateView.as_view(), name='podcast_create'),
Expand Down
24 changes: 12 additions & 12 deletions content/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get(self, request, *args, **kwargs):
'last_blog': models.Blog.objects.order_by('-pk').filter(publish=True)[:1],
'skills': models.Skill.objects.all(),
'blogs': models.Blog.objects.order_by('-pk').filter(publish=True)[1:5],
'video_casts': models.VideoCast.objects.order_by('-pk').filter(publish=True)[:4]
'video_casts': models.Videocast.objects.order_by('-pk').filter(publish=True)[:4]
}
return render(request, self.template_name, context)

Expand All @@ -34,7 +34,7 @@ def get(self, request, *args, **kwargs):
'blogs': models.Blog.objects.order_by('-pk').filter(
Q(title__icontains=query) | Q(content__icontains=query)
),
'videocasts': models.VideoCast.objects.order_by('-pk').filter(
'videocasts': models.Videocast.objects.order_by('-pk').filter(
Q(title__icontains=query) | Q(content__icontains=query)
),
'podcasts': models.Podcast.objects.order_by('-pk').filter(
Expand Down Expand Up @@ -85,39 +85,39 @@ def get_queryset(self):
return self.model.objects.filter(slug=self.kwargs['slug'])


class VideoCastCategoryCreateView(LoginRequiredMixin, SuccessMessageMixin, generic.CreateView):
model = models.VideoCastCategory
class VideocastCategoryCreateView(LoginRequiredMixin, SuccessMessageMixin, generic.CreateView):
model = models.VideocastCategory
fields = '__all__'
success_message = 'Video cast category was created successfully'

def get_success_url(self):
return reverse('content:video_cast_category_create')


class VideoCast(generic.ListView):
model = models.VideoCast
class Videocast(generic.ListView):
model = models.Videocast
template_name = 'video_cast_archive.html'


class VideoCastCreateView(LoginRequiredMixin, SuccessMessageMixin, generic.CreateView):
model = models.VideoCast
class VideocastCreateView(LoginRequiredMixin, SuccessMessageMixin, generic.CreateView):
model = models.Videocast
fields = '__all__'
success_message = 'Video cast was created successfully'

def get_success_url(self):
return reverse('content:video_cast_create')


class VideoCastArchiveByCategoryPK(generic.ListView):
model = models.VideoCast
class VideocastArchiveByCategoryPK(generic.ListView):
model = models.Videocast
template_name = 'video_cast_archive.html'

def get_queryset(self):
return self.model.objects.filter(category=self.kwargs['pk'])


class VideoCastSingle(generic.DetailView):
model = models.VideoCast
class VideocastSingle(generic.DetailView):
model = models.Videocast
template_name = 'single.html'

def get_queryset(self):
Expand Down

0 comments on commit e52a954

Please sign in to comment.