Re: Two QuerySets on a FormSet

2015-01-16 Thread Some Developer
On 12/01/15 20:46, Collin Anderson wrote: Hi, You can merge the two querysets like this. Would that help? | qs =Song.objects.filter(artist__made_by=request.user)|Song.objects.filter(album__made_by=request.user) | or use models.Q | fromdjango.db.models importQ qs =Song.objects.filter(Q(artist_

Re: Two QuerySets on a FormSet

2015-01-12 Thread Collin Anderson
Hi, You can merge the two querysets like this. Would that help? qs = Song.objects.filter(artist__made_by=request.user) | Song.objects.filter (album__made_by=request.user) or use models.Q from django.db.models import Q qs = Song.objects.filter(Q(artist__made_by=request.user) | Q(album__made_by=

Two QuerySets on a FormSet

2015-01-09 Thread Some Developer
I have a model Song which has a FormSet associated with it using a ModelForm. The Song model has two ForeignKeys (Artist and Album) but I want to limit the options shown in the FormSet to only Artists and Albums made by the currently logged in user. I know to make the QuerySets themselves but