#35682: Clarify Base<FOO>View usage in docstrings.
-------------------------------------+-------------------------------------
     Reporter:  Jesús Leganés-       |                    Owner:  (none)
  Combarro                           |
         Type:                       |                   Status:  new
  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):

 Adding the "Using this base class requires subclassing to provide a
 response mixin" comment in the Docstring would be really nice, but in
 addition to that, I would make it more explicit by adding an
 implementation of `render_to_response()` that raise a
 `NotImplementedError` exception, that at least would provide a more
 specific message than a generic "object has no attribute" one.

 Besides that, although `render_to_response` is focused on templates, is it
 also a good name for non-template-based Views? For example in my use case
 I'm generating a dict object with a GeoJSON `FeaturesCollection` object
 and later setting it as data of a `JsonResponse` object, there are no
 templates involved at all.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35682#comment:3>
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/010701915a1ee0ca-564c6404-7bf2-41f9-a142-c1df9e27ee73-000000%40eu-central-1.amazonses.com.

Reply via email to