1👍
✅
Don’t convert this function into the class-based view. Your function is clean and understandable. Class-based view will be a mess of ugly code.
If you really need to use CBV then inherit from the UpdateView. You can save the domain values as the attributes of self
and then access them in various methods:
self.some_data = "some data"
It is thread safe operation.
Source:stackexchange.com