tomchristie/django-rest-framework — pull request #1843 by pipermerriam (2014-09-06 20:33:39+00:00)
Title: Add support for limit_choices_to on related fields fixing #1811

### What is the problem / feature ?

Serializer fields representing relationships did not support or respect the [`limit_choices_to`](https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to) option as introduced from django's `ForeignKey` field.

- Issue #1811

### How did it get fixed / implemented ?

- Added a new keyword argument `limit_choices_to` to `rest_framework.relations.RelatedField`
- Added support for extracting this value from the model field when auto generating a field.
- Added support for looking this field up from the model in the *appropriate* situations.

### How can someone test / see it ?

Test coverage, as well as creating a related field using the `limit_choices_to` argument and seeing that the resulting queryset used for the field is correctly filtered.

*Here is a cute animal picture for your troubles...*

![o-monkeys-ride-dogs-570](https://cloud.githubusercontent.com/assets/824194/4176453/0685acce-3605-11e4-8082-c134ac077869.jpg)