-1
いくつかのシリアライザフィールドにurlを追加したいだけです。Django Rest FrameworkでHyperlinkedを使用するには?
class PageListSerializer(ModelSerializer):
slider = SerializerMethodField()
lookup_field = 'title'
class Meta:
model = Page
fields = [
'is_active',
'category',
'title',
'slug',
'bundle_section',
'login_register_section',
'user_review_section',
'slider',
'top_content',
'mini_content',
'panel_content',
]
たとえば、次のようなプリントは、トップ、ミニ、パネルの内容で1になります。 1の代わりに、私はURLを追加したい。
"top_content":[]、 "mini_content":[]、 "panel_content":[]
私はハイパーリンクを使用して、それを解決することができますか?ありがとうございました。