diff --git a/content/admin.py b/content/admin.py index ad1830c..1c5baed 100644 --- a/content/admin.py +++ b/content/admin.py @@ -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',)} @@ -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) diff --git a/content/context_processors.py b/content/context_processors.py index e984973..07c1b32 100644 --- a/content/context_processors.py +++ b/content/context_processors.py @@ -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 diff --git a/content/models.py b/content/models.py index 9e6b95a..891c703 100644 --- a/content/models.py +++ b/content/models.py @@ -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 :'), @@ -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 :'), @@ -107,7 +107,7 @@ class VideoCast(models.Model): verbose_name=_('Video link :') ) category = models.ManyToManyField( - VideoCastCategory + VideocastCategory ) content = RichTextUploadingField() diff --git a/content/urls.py b/content/urls.py index 5b88bae..5e4a97d 100644 --- a/content/urls.py +++ b/content/urls.py @@ -10,11 +10,11 @@ path('create/blog_category/', views.BlogCategoryCreateView.as_view(), name='blog_category_create'), path('blog//', views.BlogArchiveByCategoryPK.as_view(), name='blog_archive_by_category_pk'), path('blog//', 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//', views.VideoCastArchiveByCategoryPK.as_view(), name='video_cast_archive_by_category_pk'), - path('video_cast//', 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//', views.VideocastArchiveByCategoryPK.as_view(), name='video_cast_archive_by_category_pk'), + path('video_cast//', 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'), diff --git a/content/views.py b/content/views.py index c75bfe3..38b0273 100644 --- a/content/views.py +++ b/content/views.py @@ -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) @@ -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( @@ -85,8 +85,8 @@ 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' @@ -94,13 +94,13 @@ 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' @@ -108,16 +108,16 @@ 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):