#35682: Clarify Base<FOO>View usage in docstrings.
-------------------------------------+-------------------------------------
Reporter: Jesús Leganés- | Owner:
Combarro | YashRaj1506
Type: | Status: assigned
Cleanup/optimization |
Component: Generic views | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by YashRaj1506):
Replying to [comment:7 Clifford Gama]:
> > So one way is We can add a docstring that this class(`BaseListView`)
is meant to be subclassed by `ListView`, so use `ListView` and let
`BaseListView` be just a base class meant to be inherited (we will raise a
error too) . Would like to know your opinion, accordingly i will make the
pr.
>
> I don't think that's quite accurate. While it is true that `ListView`
subclasses `BaseListView`, it does not follow that `BaseListView` must
always be subclassed by `ListView`.
>
> I think better is:
>
> `Using this base class requires subclassing to provide a response
mixin.`
> which I copied from `BaseUpdateView`.
>
> Btw, you may want to look at other `BaseFOOView`s to see how they handle
that, and also if other abstract base views are also missing that in their
docstring.
>
I checked the other `Base<FOO>View` and yes as written in `BaseUpdateView`
inside docstring
`Using this base class requires subclassing to provide a response mixin.`
this makes totally sense and while i checked `BaseDetailView` and
`BaseListView` adding this very line would make things clear (As
`BaseDetailView` is also using render_to_response` from
`TemplateResponseMixin`) so my final proposal would be to add this
`Using this base class requires subclassing to provide a response mixin.`
inside the docstring of `BaseDetailView` and `BaseListView`.
should i make the above mentioned changes and make the pr?
--
Ticket URL: <https://code.djangoproject.com/ticket/35682#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070191659c4293-dc46af8c-7b28-4de6-8600-1ffe1df505f3-000000%40eu-central-1.amazonses.com.