-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
django rest framework install and create image Serializers
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from rest_framework import serializers | ||
from . import models | ||
|
||
class ImageSerializer(serializers.Serializer): | ||
|
||
class Meta: | ||
model = models.Image | ||
fields = '__all__' | ||
|
||
class CommentSerializer(serializers.Serializer): | ||
|
||
class Meta: | ||
model = models.Comment | ||
fidels = '__all__' | ||
|
||
class LikeSerializer(serializers.Serializer): | ||
|
||
class Meta: | ||
models = models.Like | ||
fields = '__all__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.conf.urls import url | ||
from . import views | ||
|
||
app_name = "images" | ||
urlpatterns = [ | ||
url( | ||
regex=r'^all/$', | ||
view=views.ListAllImages.as_view(), | ||
name='all_images' | ||
) | ||
] |