[22.11.26] ๐ ์ค๋ณต๋๋ฉฐ ๊ฐ ํจ์์ ์ฌ์ ์ ์ฒ๋ฆฌ๋๋ ์์
decorator ๐ SiteBulkAPIView - ๋ฒํฌ ์ฆ๊ฒจ์ฐพ๊ธฐ, ์ญ์ class SiteBulkAPIView(APIView): """ ๋ฒํฌ ํญ๋ชฉ ์ฆ๊ฒจ์ฐพ๊ธฐ, ์ญ์ api """ def get_list(self): pk_ids: list = self.request.data.get('pk_ids') return get_list_or_404(Site, id__in=pk_ids) def validate_ids(self): pk_ids: list = self.request.data.get('pk_ids') for id in pk_ids: get_object_or_404(Site,id=id) return self.get_list() def put(..
[ISSUE]decorator๋ฅผ ์ด์ฉํ ์ค๋ณต์์
์ ์ฒ๋ฆฌ
[22.11.26] ๐ ์ค๋ณต๋๋ฉฐ ๊ฐ ํจ์์ ์ฌ์ ์ ์ฒ๋ฆฌ๋๋ ์์
decorator ๐ SiteBulkAPIView - ๋ฒํฌ ์ฆ๊ฒจ์ฐพ๊ธฐ, ์ญ์ class SiteBulkAPIView(APIView): """ ๋ฒํฌ ํญ๋ชฉ ์ฆ๊ฒจ์ฐพ๊ธฐ, ์ญ์ api """ def get_list(self): pk_ids: list = self.request.data.get('pk_ids') return get_list_or_404(Site, id__in=pk_ids) def validate_ids(self): pk_ids: list = self.request.data.get('pk_ids') for id in pk_ids: get_object_or_404(Site,id=id) return self.get_list() def put(..
2023.05.05