thank you Shashank very much
it works
On Sunday, March 17, 2019 at 4:02:46 PM UTC+2, Shashank Singh wrote:
>
> OR
> from django.db.models import Q
> news_list =
> LeagueNews.objects.filter(Q(publication_date__lte=timezone.now)|Q(league_name='english')).order_by('-publication_date')[:10]
>
> AND
OR
from django.db.models import Q
news_list =
LeagueNews.objects.filter(Q(publication_date__lte=timezone.now)|Q(league_name='english')).order_by('-publication_date')[:10]
AND
news_list = LeagueNews.objects.filter(publication_date__lte=timezone.now,
hi guys
this is my view
def premierleague(request):
news_list =
LeagueNews.objects.filter((publication_date__lte=timezone.now)|(league_name='english')).order_by('-publication_date')[:10]
return render(request, 'core/premierleague.html', {'news_list':news_list})
i want to filter my objects by two
3 matches
Mail list logo