api_fields = [
APIField('a_custom_api_response'),
]
@property
def a_custom_api_response(self):
#return ["SOMETHING CUSTOM", 3.14, [1, 2, 3, 'a', 'b', 'c']]
return f"Banner Title Is: {self.banner_title}"
@property를 통해 필요한 Logic이나 정보를 API 서버에 전달할 수 있다.
'Back-End > Wagtail, Django' 카테고리의 다른 글
Wagtail API v2 Serializing Rich Text (0) | 2021.11.25 |
---|---|
Wagtail API v2 Serializing a QuerySet (0) | 2021.11.25 |
Wagtail API v2 Image Rendition Field (0) | 2021.11.24 |
Wagtail API v2 Serializers (0) | 2021.11.24 |
Wagtail API v2 Exposing Orderable Data and StreamFields (0) | 2021.11.24 |