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__made_by=request.user)|Q(album__made_by=request.user))
> |
>
> Collin
>
That's cool. I didn't realise you could do that.
I decided in the end to simplify my form code as I it would have taken
too long for a user to upload 10 songs on the same page especially in
FLAC format so I moved to single form (even though it makes the whole
process much more difficult for the user) and will hope for the best.
Anyway this is only a minimum viable product to see if the business idea
will work.
Thanks for the suggestion.