|Reported by:||tomc||Owned by:||msoedov|
|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 slug_url_kwarg and 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 10 months ago by maxocub
- Cc maxime.turcotte@… added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 9 months ago by msoedov
- Has patch set
- Owner changed from nobody to msoedov
- Status changed from new to assigned