About Annotating Conditions
To detect in the list view which items belong to a certain category, you can use an annotation like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Then in the template you can check for the annotated attribute:
1 2 3 4 5 |
|
Tips and Tricks Programming Databases Django 4.2 Django 3.2 Django 2.2 PostgreSQL MySQL SQLite
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.