django-filter Questions

8

I have some model with a timestamp field: models.py class Event(models.Model): event_type = models.CharField( max_length=100, choices=EVENT_TYPE_CHOICES, verbose_name=_("Event Type") ) even...
Photosphere asked 12/5, 2016 at 10:17

3

Solved

I have Observer model which extends User model via OneToOneRelation. I made filtering for model Checklist which has foreign key to Observer. This is the models.py code: class Observer(models.Model...
Janettajanette asked 24/3, 2017 at 19:56

2

specifically, using the example template in the django-filter docs: {% extends "base.html" %} {% block content %} <form action="" method="get"> {{ filter.form.as_p }} <input type="subm...
Osborne asked 26/2, 2014 at 15:36

3

Solved

Is it possible to format a django_filters filter form with django-crispy-forms? I've been trying to do that, but django_filters.FilterSet doesn't seem to accept the crispy forms formats (from Devic...
Baggy asked 13/1, 2021 at 12:12

1

Problem Hello, I'm using Graphene Django and Graphene Relay with Python 3.7. I'm trying to make a custom filter for the requests in GraphQL using Django filters. My table looks like this: | id(...
Diageotropism asked 14/8, 2019 at 15:46

3

Solved

I have a ListAPIView that uses the DjangoFilterBackend to filter rooms based on url parameters. The code below does this just fine. Now, I would like to sort the results based on a score calculat...
Marte asked 1/3, 2018 at 23:29

2

My class: class InvoicePeriodViewSet(viewsets.ModelViewSet): permission_classes = ( permissions.AllowAny, ) queryset = models.InvoicePeriod.objects.all() serializer_class = serializers.Invoic...
Louiselouisette asked 29/8, 2018 at 8:14

4

Solved

I have a simple question: Currently I can do this to get an object from my backend: http://127.0.0.1:8000/api/v1/boats/boats?id=10 http://127.0.0.1:8000/api/v1/boats/boats?home_port=98&id=5 ...
Royal asked 5/7, 2015 at 5:27

4

Solved

This is a slightly simplified example of the filterset I'm using, which I'm using with the DjangoFilterBackend for Django Rest Framework. I'd like to be able to send a request to /api/bookmarks/?ti...

2

Solved

I am using a Postgres ArrayField in my models. I am trying to use django filters but I get an error for them. AutoFilterSet resolved field 'flavor' with 'exact' lookup to an unrecognized field typ...
Macarthur asked 22/5, 2019 at 8:5

4

Solved

i am trying to split the string in template using custom template filter. But i got an error TemplateSyntaxError at /job/16/ 'for' statements should use the format 'for x in y': for skill in form....
Bibulous asked 30/1, 2017 at 9:36

11

Solved

I am using Django 1.7.1 and I pip installed django-filters to my virtual env at /.virtualenvs/auction2/lib/python2.7/site-packages$ It said it was installed successfully. So I placed django-filters...
Lesleylesli asked 28/4, 2015 at 20:21

7

Solved

I am using django-rest-framework with django-filter. I need to retrieve a list of Widgets where the date property is None, but no matter what query I have tried, I am getting either empty responses...
Gradin asked 3/2, 2014 at 4:23

4

As you can see from the screenshot bellow, When using and customizing django admin filters like so: class DealExpiredListFilter(admin.SimpleListFilter): title = 'expired' parameter_name = 'expir...
Pentimento asked 17/12, 2018 at 19:19

2

Solved

With = below, I could filter persons by age: qs = Person.objects.filter(age = 20) # ↑ Here But with >, <, >= and <= below, I couldn't filter persons by age: qs = Person.objects.filter...
Jaggers asked 6/4, 2012 at 6:49

4

I'm using django-filter package and I have many boolean fields. Is there a way to filter only when field is True? And show all other posibilities? For example if I have 3 fields: True, False, Fals...
Maceio asked 27/12, 2017 at 15:2

4

Solved

How do I create an "AND" filter to retrieve objects in Django? e.g I would like to retrieve a row which has a combination of two words in a single field. For example the following SQL que...
Willywillynilly asked 20/4, 2009 at 19:55

4

Solved

How can I make multiple fields search with Django-filter from model like: class Location(models.Model): loc = models.CharField(max_length=100, blank=True) loc_mansioned = models.CharField(max_le...
Goya asked 30/7, 2019 at 11:21

0

Dear fellow overflowers, I’m currently building an API based on Django Rest Framework with Django Filter. Search, filtering and sorting works reasonably well, though I was wondering about filter fa...
Eirene asked 29/11, 2022 at 9:3

8

Solved

Using django-filters, I see various solutions for how to submit multiple arguments of the same type in a single query string, for example for multiple IDs. They all suggest using a separate field t...
Dripstone asked 11/6, 2018 at 13:54

6

I tried to make a way that worked with forms, but here the class did not apply class TrainerFilter(django_filters.FilterSet): price_lt = django_filters.NumberFilter(field_name="prise", lookup_exp...
Exploit asked 1/8, 2018 at 18:4

11

Solved

I'm using the django-filter package to provide a search functionality on my List View. Now I want to add a pagination to that view as well. I'm trying to combine pagination to a filtered queryse...
Bod asked 18/5, 2017 at 12:44

4

Solved

I am using django-filter to filter a ListView and would like to display a "Clear all filters" link if any filters are applied. Due to the generic nature of the filtering system I haven't yet found...
Kuhn asked 9/4, 2018 at 11:55

1

I have a model similar to this: # segment/models.py from django.db import models from django.contrib.postgres.fields import JSONField class Segment(models.Model): name = models.CharField(max_len...
Maris asked 11/11, 2019 at 19:0

2

Here I trying to convert Django rawsql query to Django queryset. But the problem is - how to implement distinct in two columns? SQL query: count(distinct ra, category) as order_type Django que...
Aluino asked 3/5, 2020 at 7:14

© 2022 - 2025 — McMap. All rights reserved.