Hi, new to django, this might be a simple/obvious question, so I apologise in advance.
I have the following model
class Team(models.Model):
name = models.CharField(max_length=100)
members = models.ManyToManyField(User, related_name="members", blank=True, null=True)
And the following view (controller)
def my_teams(request):
my_list = Team.objects.filter(???????).order_by('name')
return render_to_response('teams/index.html', {'my_list': my_list})
The objective of this view is to list only those project which the current logged in user is a member of. Being a many to many relationship there can be many members in each team.
Any advice on how to achieve this would be greatly appreciated.