Answer the question
In order to leave comments, you need to log in
How to auto increment in django?
How to properly autoincrement in django?
It is necessary that each category has its own counter of articles.
Answer the question
In order to leave comments, you need to log in
articles_in_category = Article.objects.filter(category=category).count()
category.articles_set.count()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question