tomchristie/django-rest-framework — pull request #795 by iekadou (2013-04-18 11:31:50+00:00)
Title: Fix non form many relations

## Single Relations not need to be a list anymore when sent to Serializer

When sending a request using JSON to a serializer.SlugRelatedField(many=True) it was only possible to send single instances as a list:
```JSON
{"related_object": ["slug"]}
```

Now it is possible to send a single slug as a string:
```JSON
{"related_object": "slug"}
```
It was not able before, because a string is iterable and a the string was interpreted as a list, resulting in one slug lookup for every char in the posted string.

It is also possible to send PKs this way now:
```JSON
{"related_object": 5}
```

Before you were forced to do it like this:

```JSON
{"related_object": [5]}
```

## Why do we need this?

If you are on a mobile device, having a HTML5 Form and serialize it to JSON it will result in these ways:

```JSON
{"related_object": ""}
```
```JSON
{"related_object": "slug"}
```
```JSON
{"related_object": ["slug1", "slug2"]}
```