Answer the question
In order to leave comments, you need to log in
How to make a filter by one field for all views?
Hello.
I would like to clarify how to do this correctly:
- the course model has a field activity_of_course = models.BooleanField(default=True, verbose_name="Is the course active?")
- the courses are displayed in 20 views
- you need to display only those courses where activity_of_course = True.
Is there some way to do this correctly instead of writing a filter in each of the 20 views?
Answer the question
In order to leave comments, you need to log in
https://docs.djangoproject.com/en/1.10/topics/db/m... this is what you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question