I have a user profile that contains a manytomany field which points to a set of favorite objects.
I have a queryset that returns an set of those types of objects, independent of the favorites (though it may contain favorites).
What I want to do is this:
{% for object in objects %}
<p>{% if user.get_profile.favorites contains object %} Unfavorite {% else %} Favorite {% endif %}</p>
{% endfor %}
But thus far, I cannot find an easy to way do this. Ideas?
in