RESTful API๐Ÿ’ก: ์žฅ๊ณ  DRF์™€ Serializer ๋ฟŒ์‹œ๊ธฐ

muchogustoยท2020๋…„ 10์›” 29์ผ
0

๐ŸŽธ Play the Djangoย 

๋ชฉ๋ก ๋ณด๊ธฐ
44/53

RESTfulํ•œ API๋ฅผ ๋งŒ๋“ค์–ด ๋ณด์ž!

API ๋ฌธ์„œ๋ฅผ ์œ„ํ•œ Swagger๐Ÿ˜Ž

RESTful API๐Ÿ’ก: ๋‚˜์˜ swag๐Ÿ˜Ž swagger!

Django Serializer

  • ์ง๋ ฌํ™”(serialize)๋Š” ์ ํ•ฉํ•œ ๊ตฌ์กฐ๋กœ ์žฌ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ํฌ๋งท์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๊ณผ์ •์„ ์˜๋ฏธ

rest_framework.serializers

  • class BaseSerializer(Field)
  • class SerializerMetaclass(type)
  • def as_serializer_error(exc)
  • class Serializer(BaseSerializer, metaclass=SerializerMetaclass)
  • def raise_errors_on_nested_writes(method_name, serializer, vlidated_data)
  • class ModelSerializer(Serializer)
  • class HyperLinkedModelSerializer(ModelSerializer)

Reference

  • Python Django ๊ฐ•์ขŒ : ์ œ 7๊ฐ• - Serializers (https://076923.github.io//posts/Python-Django-7/)
  • Efficient Bulk Create with Django Rest Framework (https://medium.com/swlh/efficient-bulk-create-with-django-rest-framework-f73da6af7ddc)
  • https://devissue.wordpress.com/2015/02/01/pycharm%ea%b3%bc-%ed%95%a8%ea%bb%98-django%ec%99%80-restframework%eb%a5%bc-%ed%99%9c%ec%9a%a9%ed%95%9c-%ec%9b%b9-%ec%82%ac%ec%9d%b4%ed%8a%b8-%ea%b5%ac%ec%b6%95%ed%95%98%ea%b8%b0/
  • https://pilyeooong.tistory.com/entry/DRF-Django-REST-Framework
  • https://www.django-rest-framework.org/tutorial/1-serialization/
  • https://medium.com/weekly-webtips/9-best-practices-for-rest-api-design-7fb0b462099b
profile
#์˜์‹์˜ํ๋ฆ„ #์ˆœ๊ฐ„์ˆœ๊ฐ„ #์ƒ๊ฐ์˜์Šค๋ƒ…์ƒท

0๊ฐœ์˜ ๋Œ“๊ธ€