def vendor_view(self, request, vendor_id): context_data = admin_site.each_context(request) context_data['data'] = VendorUser.objects.all() context_data['site_title'] = ugettext_lazy('Vendor') return TemplateResponse(request, 'admin/vendor_view.html', context=context_data)
def hospital_view(self, request, hospital_id): context_data = admin_site.each_context(request) context_data['data'] = HospitalUser.objects.get(id=hospital_id) context_data['site_title'] = ugettext_lazy('Hospital') return TemplateResponse(request, 'admin/hospital_view.html', context=context_data)
def vehicle_add(self, request, hospital_id): context_data = admin_site.each_context(request) context_data['data'] = HospitalUser.objects.get(id=hospital_id) context_data['category'] = VehicleCategory.objects.all() context_data['site_title'] = ugettext_lazy('Hospital') return TemplateResponse(request, 'admin/hospital/add_vehicle.html', context=context_data)
def extra_context(self, request): context = admin_site.each_context(request) context['opts'] = Vendor._meta context['site_title'] = ugettext_lazy('Vendor') return context
def extra_context(self, request): context = admin_site.each_context(request) context['opts'] = HospitalUser._meta context['site_title'] = ugettext_lazy('Hospital') return context