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.
--
Ticket URL: <https://code.djangoproject.com/ticket/25385>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Have you discussed the idea with anyone? If not, could you please raise it
on the DevelopersMailingList to see if there are any objections?
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:1>
* component: Core (URLs) => Generic views
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:2>
Comment (by timgraham):
[https://groups.google.com/d/topic/django-
developers/sdYPQnfcXGU/discussion django-developers thread]
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:3>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:4>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:5>
Comment (by auvipy):
anyone working on this? or volunteer needed? I'm interested to work on it
:D
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:6>
Comment (by timgraham):
If there's no activity on a ticket in weeks, it's probably fine to
reassign it.
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:7>
* owner: jambonrose => auvipy
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:8>
Comment (by auvipy):
Hi tim,
View class need to be moved from generic module to views module, what
whould be the module name? base.py? or view.py?
after moving specific classes it will be needed to fix the import in
existing all modules/files too. does the contextmixin need to be moved
along with VIEW class?
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:9>
Comment (by auvipy):
+ deprecation warnings needed too for moved classes?
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:10>
Comment (by timgraham):
I think it's enough to add an import for `from django.views.generic.base
import View` in `django/views/__init__.py`. I don't see much gain in
moving the code.
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:11>
Comment (by auvipy):
Replying to [comment:11 timgraham]:
> I think it's enough to add an import for `from django.views.generic.base
import View` in `django/views/__init__.py`. I don't see much gain in
moving the code.
that seems much simpler then!!!
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:12>
Comment (by auvipy):
PR created
https://github.com/django/django/pull/5742
Docs + Release notes needed.
** should It be back ported to 1.8 and 1.9?
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:13>
Comment (by auvipy):
./django/views/__init__.py:1:1: F401 'View' imported but unused
Build step 'Execute shell' marked build as failure
Setting status of 3b403668b22bea5315bc1c6fbb8237527d43ebb4 to FAILURE with
url http://djangoci.com/job/flake8/6233/ and message: 'Build finished. No
test results found.'
Using context: flake8
Finished: FAILURE
Then test should be added too to make the build pass?
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:14>
Comment (by timgraham):
You can fix the flake8 failure by adding `__all__ = ['View']` in that
file.
It's a new feature, so it's not a candidate for backport. See our
[https://docs.djangoproject.com/en/dev/internals/release-process
/#supported-versions supported versions policy].
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:15>
Comment (by auvipy):
ok thanks will update accordingly
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:16>
Comment (by auvipy):
I guess only release notes and some docs update and squash commit required
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:17>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/5951
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:18>
Comment (by auvipy):
Replying to [comment:18 varun]:
> PR: https://github.com/django/django/pull/5951
Hi Varun, I've already send a PR and the PR is still open. besides I
haven't deassigned the issue yet :) so to avoid duplicate works better to
ask the assigned guy first.
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:19>
Comment (by varun):
Replying to [comment:19 auvipy]:
Hi !!
I saw your PR and there wasn't any activity or follow up in that from last
18 days. I guess that's a reasonable period to reassign the ticket. There
wasn't much of work in this anyway :)
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:20>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"3d6474e1a50dbaf9684f7fb34bfccb77630f27be" 3d6474e1]:
{{{
#!CommitTicketReference repository=""
revision="3d6474e1a50dbaf9684f7fb34bfccb77630f27be"
Fixed #25385 -- Allowed importing views.generic.View from views.View.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25385#comment:21>