#teams/models.py
class Team(models.Model):
user = models.ForeignKey(User)
class Coordinator(models.Model):
user = models.ForeignKey(User)
class Wishlist(models.Model):
team = models.ForeignKey(Team)
coordinator = models.ForeignKey(Coordinator)
#sybcdb creates a new table called teams_wishlist with the fields:
# id, team_id, coordinator_id, etc (extra wishlist related fields).
#in the shell I can't get to the wishlist through the Team object...
#team.wishlist says 'Team' object has no attribute 'wishlist'
#however:
wishlists = Wishlist.objects.all()
for w in wishlists:
print w.coordinator
print w.team
#returns a list of the teams and coordinators.