1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #23482 -- Added SingleObjectMixin.query_pk_and_slug

Enabling the attribute causes get_object() to perform its lookup
using both the primary key and the slug.
This commit is contained in:
Jon Dufresne
2014-09-12 18:23:35 -07:00
committed by Tim Graham
parent 85f6d89313
commit 8c581ff394
5 changed files with 73 additions and 10 deletions

View File

@@ -225,6 +225,12 @@ Generic Views
:attr:`~django.views.generic.list.MultipleObjectMixin.ordering` or overriding
:meth:`~django.views.generic.list.MultipleObjectMixin.get_ordering()`.
* The new :attr:`SingleObjectMixin.query_pk_and_slug
<django.views.generic.detail.SingleObjectMixin.query_pk_and_slug>`
attribute allows changing the behavior of
:meth:`~django.views.generic.detail.SingleObjectMixin.get_object()`
so that it'll perform its lookup using both the primary key and the slug.
Internationalization
^^^^^^^^^^^^^^^^^^^^