def index(request, app_label): from public.functions import get_app_list apps = get_app_list() context = { 'apps': apps, 'app_label': app_label } return TemplateResponse(request, 'dashboard.html', context)
def index(self, request): from django.template.response import TemplateResponse from public.functions import get_app_list context = { 'apps': get_app_list(), 'app_label': 'dashboard' } template = "dashboard.html" return TemplateResponse(request, template, context)
def page_view(request, app_label, model_name): heads, actions = page_generator(request, app_label, model_name) app_list = get_app_list() context = dict(app_label=app_label, model_name=model_name, heads=heads, actions=actions, apps=app_list) templates = [ "{0}_{1}.html".format(app_label.lower(), model_name.lower()), "model_page.html", "public/web_base.html", ] return render(request, templates, context)
def page_view(request, app_label, model_name): heads, actions = page_generator(request, app_label, model_name) app_list = get_app_list() context = dict(app_label=app_label, model_name=model_name, heads=heads, actions=actions, apps=app_list) templates = [ '{0}_{1}.html'.format(app_label.lower(), model_name.lower()), 'model_page.html', 'public/web_base.html' ] return render(request, templates, context)
def index(self, request): from django.template.response import TemplateResponse from public.functions import get_app_list context = {'apps': get_app_list(), 'app_label': 'dashboard'} template = "dashboard.html" return TemplateResponse(request, template, context)