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_
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=
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
3 matches
Mail list logo