Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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)
- #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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement