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.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/54B93220.8050803%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.