uncommented endpoints for create/update/delete news app
This commit is contained in:
parent
610ecb6f35
commit
6ac20fc4b2
|
|
@ -72,7 +72,6 @@ class Collection(ProjectBaseMixin, CollectionNameMixin,
|
|||
return f'{self.name}'
|
||||
|
||||
|
||||
|
||||
class CollectionItemQuerySet(models.QuerySet):
|
||||
"""QuerySet for model CollectionItem."""
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class NewsCreateUpdateSerializer(NewsSerializer):
|
|||
title = serializers.JSONField()
|
||||
subtitle = serializers.JSONField()
|
||||
description = serializers.JSONField()
|
||||
image = serializers.ImageField(required=True)
|
||||
news_type = serializers.PrimaryKeyRelatedField(
|
||||
queryset=models.NewsType.objects.all(), write_only=True)
|
||||
address = serializers.PrimaryKeyRelatedField(
|
||||
|
|
@ -69,5 +70,6 @@ class NewsCreateUpdateSerializer(NewsSerializer):
|
|||
'start',
|
||||
'end',
|
||||
'playlist',
|
||||
'address'
|
||||
'address',
|
||||
'image',
|
||||
]
|
||||
|
|
@ -7,9 +7,9 @@ app_name = 'news'
|
|||
|
||||
urlpatterns = [
|
||||
path('', common.NewsList.as_view(), name='news_list'),
|
||||
# path('create/', common.NewsCreate.as_view(), name='news_create'),
|
||||
# path('<int:pk>/', common.NewsDetail.as_view(), name='news_detail'),
|
||||
# path('<int:pk>/update/', common.NewsUpdate.as_view(), name='news_update'),
|
||||
# path('<int:pk>/delete/', common.NewsDelete.as_view(), name='news_delete'),
|
||||
path('create/', common.NewsCreate.as_view(), name='news_create'),
|
||||
path('<int:pk>/', common.NewsDetail.as_view(), name='news_detail'),
|
||||
path('<int:pk>/update/', common.NewsUpdate.as_view(), name='news_update'),
|
||||
path('<int:pk>/delete/', common.NewsDelete.as_view(), name='news_delete'),
|
||||
path('type/', common.NewsTypeList.as_view(), name='news_type'),
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user