Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

details view should be class based #4646

Open
philippze opened this issue Nov 2, 2015 · 4 comments
Open

details view should be class based #4646

philippze opened this issue Nov 2, 2015 · 4 comments

Comments

@philippze
Copy link
Contributor

The details view is a function of more than 100 lines which makes it difficult to extend it. A class based version would make it much easier to create little modifications.

This is my use case:

  • Redirect to the domain listed in a page's site field if the page is called with the wrong domain.

Currently this would be done with a middleware where one must determine the requested Page object a second time. It would be easier and more efficient if one could simply override some function in the view code.

@yakky
Copy link
Member

yakky commented Nov 2, 2015

Why not using request.current_page in the middleware?
Anyway, while not on top of the todo list, refactoring the view to make it more modular sounds a nice improvement

@philippze
Copy link
Contributor Author

Fine. So I put refactoring the view on my own todo list and make a pull request some time.

@yakky
Copy link
Member

yakky commented Nov 2, 2015

@philippze awesome!

philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
@philippze
Copy link
Contributor Author

philippze commented Apr 28, 2017

I'm working on this issue today.

I'm proceeding in small steps, try to change no logic, and the tests still work.

However, the code in cms/views.py is looking very different already...

philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 28, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 29, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 30, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 30, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 30, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 30, 2017
philippze added a commit to philippze/django-cms that referenced this issue Apr 30, 2017
@Aiky30 Aiky30 added this to the DCA Needs clarification milestone Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants