Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
How would you complete the ComplexDetailView class to create a view that displays and updates a CustomModel object, while also checking for user permissions? Fill in the blanks in the code to make it work correctly.Built-in and custom mixins for Class Based Views
Crafting the perfect view puzzle
Report a typo
Fill in the gaps with the relevant elements
class ComplexDetailView(, , , ):
model = CustomModel
template_name = 'complex_detail.html'
form_class = CustomForm
success_url = reverse_lazy('success_page')
def get_object(self, queryset=None):
obj = ().get_object(queryset)
if not self.request.user.has_perm('app.change_custommodel'):
raise PermissionDenied()
return objCreate a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.