#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 Jesús Leganés-Combarro):

 Replying to [comment:12 Clifford Gama]:
 > Replying to [comment:11 Jesús Leganés-Combarro]:
 > > In addition of the DocString, what about adding an implementation of
 `render_to_response()` that `raise NotImplementedError()` to make the
 error explicit in runtime?
 >
 > Sounds like a good idea, but I wasn't sure about it since no
 `NotImplementedError()` are raised in any of the other `BaseFOOView`s and
 most other Mixins. I think we will have to ask about this in the Django
 Internals Forum.
 >
 I would personally add it in all the `BaseFOOView`s, it's a bit nasty to
 call a method that doesn't exist just because it's expected to be
 implemented in a subclass.

 OTOH, doing so would break compatibility in the cases where it's not
 implemented in a subclass, but in another sibling class in the MRO, so it
 would break in case the sibling class implementing it is defined after the
 `BaseFOOView`s with the implementation raising the exception, but IMHO,
 that's already broken code that's sucesfully running just by luck they are
 defined in the correct MRO order.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35682#comment:13>
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/0107019167606c75-39aecead-b6d3-45bd-bddc-767f32446240-000000%40eu-central-1.amazonses.com.

Reply via email to