Class based views #104
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status quo
The project is based on ye good ol fashioned method based views, which is fine and works properly.
However, we surely could reduce the size of our code base by switching to class based views.
Improvement
Refactor views from method based to class based, including all advantages class inheritance provides!
Our
BaseModalFormprovides a methodprocess_request()which handlesGETas wekk asPOSTrequests. This is handy in case of function based view structure, where the handling ofGETandPOSTdoes not need to be placed inside the view logic.However, to be able to support class based views on routes where
BaseModalFormderivatives are used, the abstract class view will call the same logic onget()as onpost()to ensure the same behaviour as previously on function based views.This might look strange, but is an effective way to support the refactoring without touching existing logic on
BaseModalForm.Merged in #200