django/django — pull request #1205 by tomchristie (2013-05-23 13:55:26+00:00)
Title: Added `SingleobjectMixin.lookup_field`.

Deprecates `pk_url_kwarg`, `slug_url_kwarg`, and `slug_field`.

References [trac20342](https://code.djangoproject.com/ticket/20342).

Quoting the trac ticket...

> SingleObjectMixin currently exposes these three attributes and one method all dealing with queryset filter arguments...
>
> pk_url_kwarg = 'pk'
> slug_field = 'slug'
> slug_url_kwarg = 'slug'
> get_slug_field()
>
> I was wondering if it would be worth considering simplifying the API somewhat, by moving those three attributes, and that method, into a PendingDeprecation state, and replacing their usage with a single attribute instead, that is used both as the URL kwarg, and as the queryset filter.
>
> lookup_field = 'pk'
>
> That'd (eventually) lead to a simpler get_object implementation internally, and (immediately) present a slightly nicer, simpler API.