W
W
Werdjill2020-04-27 19:56:40
Django
Werdjill, 2020-04-27 19:56:40

How to calculate object base length in Django?

Good evening, how to count the number of objects in Django, for example, there is a website for selling cars and 5 conditional ads, how to implement counting ads and displaying the number on the screen, let's say < In your city 5 cars are for sale >, thank you for your advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-04-27
@Realmixer

Let's say this:
Car.objects.filter(city='moscow').count()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question