1👍
current_discounts = CurrentDiscount.objects.all()
In view
for ds in current_discounts:
print ds.discount.description
In html
{% for ds in current_discounts %}
{{ds.discount.description}}
{% endfor %}
0👍
It’s a question of forignkey. You can set a forignkeyModel, and use
c = CurrentDiscount.objects.all()
c.availableDiscounts_set.all()
- [Answer]-Django, get list of an attribute for multiple attributes
- [Answer]-Django doesn't load css files
Source:stackexchange.com