initial commit
This commit is contained in:
15
cabinet/utils.py
Normal file
15
cabinet/utils.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
||||
|
||||
class CabinetViewMixin(LoginRequiredMixin):
|
||||
title = 'No title'
|
||||
sidebar_section = None
|
||||
|
||||
def get_title(self):
|
||||
return self.title
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super(CabinetViewMixin, self).get_context_data(**kwargs)
|
||||
ctx['title'] = self.get_title()
|
||||
ctx['sidebar_section'] = self.sidebar_section
|
||||
return ctx
|
Reference in New Issue
Block a user