I have a situation where my client is attempting to write a representation that includes a list of fk's
{
languages: [1]
last_name: "Beecher"
settings: 1
state: "NY"
}
But when reading it in, I'd like to have a nested representation to cut back on roundtrips
{
languages: [{id:1, created:2013-07-21T01:38:33.569Z, modified:2013-07-21T01:38:33.569Z, language:testing}]
last_name: "Beecher"
settings: {
created: "2013-07-20T22:04:17.998Z"
email_blog: false
email_booking_accepted_denied: false
email_booking_request: false
email_friend_joined: false
email_groups_added_network: false
email_new_review: false
email_news: false
email_upcoming_booking_remind: false
id: 1
mobile_booking_accepted_denied: false
mobile_booking_request: false
mobile_friend_joined: false
mobile_groups_added_network: false
mobile_new_review: false
mobile_upcoming_booking_remind: false
modified: "2013-07-20T22:04:18.000Z"
user: 1
}
state: "NY"
}
Reading is no problem using a model serializer and depth=1 - but attempting to write gives an error "ValueError('instance should be a queryset or other iterable with many=True')" When attempting to check a many related field for iter
Conversely, turning off depth makes writing work just as I'd like, but reading is no good.
Is there something I'm totally missing here? It seems like it should be a simple change, but I can only get one or the other working