From 754c1afd1e897453a365a60deb5158ddbc5c74f5 Mon Sep 17 00:00:00 2001 From: Yaroslav Lysiuk Date: Mon, 14 Aug 2023 08:50:25 +0300 Subject: [PATCH] Changes --- taxi/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/taxi/views.py b/taxi/views.py index 956b3dc3f..ac9001b12 100644 --- a/taxi/views.py +++ b/taxi/views.py @@ -1,13 +1,14 @@ +from django.contrib.auth import get_user_model from django.http import HttpResponse from django.shortcuts import render -from taxi import models +from taxi.models import Manufacturer, Car def index(request): - num_drivers = models.Driver.objects.count() - num_manufacturers = models.Manufacturer.objects.count() - num_cars = models.Car.objects.count() + num_drivers = get_user_model().objects.count() + num_manufacturers = Manufacturer.objects.count() + num_cars = Car.objects.count() context = { "num_drivers": num_drivers, "num_manufacturers": num_manufacturers,