FAQ Page

866

IL WEB

  • Django - filter su models

    def BootstrapFilterView(request):
         
        qs = Journal.objects.all()
        #categories= Category.objects.all()
        #categories= Category.objects.filter(name__icontains="Lombardia").filter(name__icontains="Toscana")
     

        categories= Category.objects.filter(Q(name__icontains="Lombardia") | Q(name__icontains="Toscana"))
        
         
      
        title_contains_query = request.GET.get('title_contains')
        title_or_author_query = request.GET.get('title_or_author')
        id_exact_query = request.GET.get('id_exact')

  • Rif. 866