سؤال

This might be a basic question but I am a total newbie to django and rest framework.

In django, we have a natural key with the help of which we can write foreign key elements into a json file during the serialization process. Can this also be done with the serializers in Rest Framework?

هل كانت مفيدة؟

المحلول

Django REST Framework has RelatedField and PrimaryKeyRelatedField.

Check it: http://www.django-rest-framework.org/api-guide/relations

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top