HyperlinkedModelSerializer

19 views
Skip to first unread message

Scott

unread,
Sep 18, 2019, 8:38:09 PM9/18/19
to Django REST framework
What is the best way to use a HyperlinkedModelSerializer with a OneToOneField?

I have two models (A, B)
A and  B have a one-to-one association.

Model B use's the A_id as it's own primary key value, which is the default setting.

I'm able to create records for resource A, but when I attempt to create them for resource resource B using the url for A in place of the primary key I get the following error:
a_id cannot be null.

My url is something like:
HTTPIE
Reply all
Reply to author
Forward
0 new messages