moving the class-based View base class out of django.views.generic?

138 views
Skip to first unread message

Tim Graham

unread,
Sep 22, 2015, 10:41:48 AM9/22/15
to Django developers (Contributions to Django itself)

Class-based view users, does this proposal from https://code.djangoproject.com/ticket/25385 seem like a good one?

---

Whenever I talk about class-based views and how their concept is separate from generic views (typically in a class setting), the question I am asked is invariably: if they are different, why do we import View from django.views.generic?

To help developers better avoid confusion and better separate the concepts, I would like to change the import of the View class. Ideally:

from django.views import View

I would furthermore like to move View from the generic directory into it's own module.

John Paulett

unread,
Sep 22, 2015, 10:53:50 AM9/22/15
to django-d...@googlegroups.com
Definitely seems like a good idea to me.  Even as a frequent CBV user, it always takes me a few seconds to remember to import from generic.

John Paulett

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ffad765a-0803-47c1-8bd0-9bd69fff0835%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Christie

unread,
Sep 22, 2015, 10:58:08 AM9/22/15
to Django developers (Contributions to Django itself)
Yup, I think that's a good proposal.

Marc Tamlyn

unread,
Sep 22, 2015, 11:23:33 AM9/22/15
to django-d...@googlegroups.com
The idea has been discussed before and was rejected as needless code churn if I remember correctly. I'm afraid I can't remember when or where this discussion happened, it could have been an in person one at a sprint, I can't immediately find a record on this mailing list. Perhaps the fact it's come up again makes it more significant (and we can always keep the import shim).

FWIW, I am +0, I can see the reasoning but in my opinion we have worse import paths (conf.urls and core.urlresolvers anyone?)



On 22 September 2015 at 15:58, Tom Christie <christ...@gmail.com> wrote:
Yup, I think that's a good proposal.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.

Collin Anderson

unread,
Sep 22, 2015, 1:07:20 PM9/22/15
to django-d...@googlegroups.com
Could we have permanent backward-compatible (no deprecation timeline) shims? I'm -0 if not because it's yet-another thing that everyone needs to change when upgrading.

Josh Smeaton

unread,
Sep 22, 2015, 7:06:48 PM9/22/15
to Django developers (Contributions to Django itself)
Could we have permanent backward-compatible (no deprecation timeline) shims? I'm -0 if not because it's yet-another thing that everyone needs to change when upgrading.

+1 

Russell Keith-Magee

unread,
Sep 22, 2015, 8:09:14 PM9/22/15
to Django Developers
That would be my preferred approach, too.

Yours,
Russ Magee %-)

Paulo Gabriel Poiati

unread,
Sep 27, 2015, 1:57:33 PM9/27/15
to Django Developers
Very handy +1.
--
[]'s
Paulo Poiati

blog.paulopoiati.com

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
Reply all
Reply to author
Forward
0 new messages