All Questions
996
questions
1
vote
0
answers
17
views
Filtering across multiple fields from a subquery where there is no related field
I'm trying to find a portable way to express the following record filtering query using the Django ORM.
The intention is to:
take a subquery of FilterSpec (eg. with a common FilterGroup)
find all ...
0
votes
0
answers
50
views
How to apply ordering based on another model field data in DRF?
I am trying to develop an API to filter JobApplication model data, and facing problem to ordering the response data for a custom field.
Here is my JobApplication model.
class JobApplication(models....
0
votes
1
answer
64
views
Best approach to build a filterable table with Django
I have created a Template where you have a HTML-table and a iframe that's rendering pdf's that a user has previously uploaded:
The goal is that a user can match the table entries to a pdf / multiple ...
-1
votes
1
answer
17
views
Django's filter clears foreign keys
In views.py, if I defining variable like clients_list = Clients.objects.all() and reading them in html like {{ clients_list }} then I get all data correct.
But if I make filtering like clients_list = ...
0
votes
0
answers
98
views
Django: How to filter based on custom field generated in serializer to_representation
I have a custom field in my extra action view that gets added by overriding to_representation() in serializer. I want to add a filter based on that value. How can I achieve that?
views.py
class ...
0
votes
0
answers
25
views
Django - How to filter model objects by certain attribute and use it for front-end?
I am a beginner and building a website to showcase wines.
This is the model for Wine:
class Wine(models.Model):
name = models.CharField(max_length=100)
type = models.CharField(max_length=50)
...
0
votes
0
answers
24
views
Difficulty using multiple filters simultaneously in Django view with HTMX [duplicate]
I'm encountering an issue with using multiple filters simultaneously in a Django view while incorporating HTMX for asynchronous updates. Here's a breakdown of the relevant code and the problem I'm ...
0
votes
0
answers
42
views
To create a product color filter with django-filter ModelMultipleChoiceFilter with color Preview(color swatches) for e-commerce web application
I'm honing my django skills by writing my own e-commerce web application from scratch--and I want to let users see a preview for the product colors in the color filters.
Here is what I currently have, ...
0
votes
1
answer
65
views
Case-insensitive filter in Django admin using SimpleListFilter
I have a SimpleListFilter in the Django admin panel that filters values (ingredients) based on their first letters (see the code below). The issue is that ingredients could be saved/updated in the ...
0
votes
1
answer
33
views
Django filter not using correct template
I am working on a Django web application. The app includes a filter that is calling the wrong template--even though 'template_name' is set in both the view and the filter. I don't understand why ...
0
votes
0
answers
25
views
Paginate items after filtering by ajax
guys!
I have a page with brands and two checkboxes list, category and country. I realized filter logic by jsonresponse, and ajax:
its my filter view
its my checkbox template
its my js
its a part of ...
0
votes
0
answers
39
views
Regarding filters in django
<div class="project-container">
<div class="project-header">
<div class="status-container">
<h1 class="project-header-...
0
votes
0
answers
35
views
django autocomplete for filtered queryset
I am trying to customize django-admin when working with django rest framework. I am adding Article object, which may have Participants (users who contributed to writing the article), and I want to ...
0
votes
1
answer
88
views
django admin autocomplete filter without foreign key
I have this model:
class Person(models.Model):
first_name = models.CharField(max_length=50, null=True, blank=True)
last_name = models.CharField(max_length=50, null=True, blank=True)
age = ...
0
votes
0
answers
48
views
Data filter for export to excel
I added a save button to the Excel file from the database. now we need this button to use all the filters applied in the dashboard in the table tag, here is the html code
<table class="table ...