Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Some Views as CBV #487

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Conversation

leonardoo
Copy link
Contributor

this commit has a mix in support django 1.8 and convert some views to CBV, for better maintainability, also #485 add some support and remove warnings

@swistakm
Copy link
Contributor

You have mentioned django1.8 support. Does it now passes tests on django1.8? Could we add a new test environment to test it?

@leonardoo
Copy link
Contributor Author

@swistakm the app past all test in django 1.8, without anychange but show a lot of warnings, when executed

@swistakm
Copy link
Contributor

OK, I reviewed this briefly and I really like refactorization done to views because it really makes code easier to read and maintain.

But there is a serious problem and can be merged in that form. Many userena users customize views by importing them from userena.views and manually including them in their urlconfs. This is in fact a way to customize userena behaviour that is suggested in some parts of documentation. I think that this change would break a lot of user builds.

So there should be still option to import views like before. They could be simply instantiated in userena.views.__init__ using 'as_view()` class methods.

I think that we could drop all function based views in userena 2.x and successfully deprecate them in incoming minor releases. I think that this would go to userena==1.5.0 and should also mark as deprecated those views that were replaced by CBV versions.

Anyway I really like that change but it needs some improvements to be merged.

@leonardoo
Copy link
Contributor Author

@swistakm Is this what you mean or have to create something more explicit warnings?

@swistakm swistakm added this to the 2.1.0 milestone Mar 22, 2016
@nooperpudd
Copy link

when to merge this?

@swistakm
Copy link
Contributor

I wanted to make it a part of 2.0.0 release but it was just the time to release support for django 1.9 and this PR was not reviewed yet.

I want to make these class-based views as a part of 2.1.0 release but this will require some additional work:

  • this feature needs to be rebased, tested and reviewed once again
  • all new class based views need to have backwards compatible functional counterparts provided for users that extended them in their own url configurations
  • functional alternatives needs to have deprecation warnings since they will be removed in 3.0.0
  • all documentation needs to be updated (tutorials, FAQ, examples)
  • probably demo application needs to be updated too
  • all views that were not yet ported to CBV should be rewritten too

Without the help of others this will take some time because I have a very limited resources.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants