|Reported by:||tomc||Owned by:||Alex Myasoedov|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||no|
Belatedly following on from https://code.djangoproject.com/ticket/21898
I feel that
pk_url_kwarg don't feel very in keeping with the rest of django to me, and some thought could be put into improving this part of the API.
My personal opinion is that I don't think that SingleObjectMixin should require a pk, slug, or these variables to be set if you provide a queryset of your own. I don't see any reason why we shouldn't have a
DetailView without any arguments in the URL at all, if we provide a single object in some manner. At the moment to do this, we have to override
get_object() and essentially rewrite it, which does not feel very elegant to me.
Change History (9)
comment:1 Changed 2 years ago by
|Patch needs improvement:||unset|
comment:3 Changed 2 years ago by
|Owner:||changed from nobody to Alex Myasoedov|
|Status:||new → assigned|