About Retrieving the Proxy Model Instance
Django doesn't have a default way to switch to an instance of a proxy model when you have an instance of the original model. But this can be achieved with the following custom template filter (or analogous helper function):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Here is how it would be used in the template:
1 2 3 4 5 6 7 |
|
Tips and Tricks Programming Architecture Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.