Problem customizing search_get_results() method in Django Admin page to get Custom Search

I have an app in Django and I would like to use this template:

{% load i18n static %}
{% if cl.search_fields %}
<div className="form-group">
  <div class="search-notes col-md-6 col-sm-12">Para busqueda de terminos exactos poner el texto entre comillas Ej  para editorial "VANGUARDIA PICTORICA" o en ISBN "978-959-7126-52-2"</div>
</div>

      <div class="for-group-container row"> 
       <div class="form-group col-md-3">
        <input type="text" name="no_reg" class="form-control" placeholder="Número de Registro" />
   <br>     
         <input type="text" name="inputTitulo" class="form-control" placeholder="Título" />
     <br>

          
     
    <br/>
     <input type="text" name="inputAutor" class="form-control" placeholder="Autor" />
    <br/>
    </div>      

    <div class="form-group col-md-3">
    <input type="text" name="inputEditorial" class="form-control" placeholder="Editorial" />
    <br/>

    <input type="text" name="inputDescriptor" class="form-control" placeholder="Descriptor" />
    <br/>

    <div class="form-group col-md-3">
    <input type="text" name="inputResumen" class="form-control" placeholder="Resumen" />
    <br/>

<input type="submit" value="{% translate 'Search' %}">

  </div>
{% if show_result_count %}
    <span class="small quiet">{% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}{{ is_popup_var }}=1{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)</span>
{% endif %}
{% for pair in cl.params.items %}
    {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}">{% endif %}
{% endfor %}
</div>
{% if cl.search_help_text %}
<br class="clear">
<div class="help" id="searchbar_helptext">{{ cl.search_help_text }}</div>
{% endif %}
</form></div>
{% endif %}

as to implement a custom search in the django admin page. My admin.py class whrere I would like to implement the custom search is as follows:

@admin.register(OpacLibro)
class LibroModelAdmin(admin.ModelAdmin):
#class LibroModelAdmin(DjangoQLSearchMixin,admin.ModelAdmin):

    form = LibroForm
    #search_form = LibroCustomSearchForm
    search_fields = ['no_reg','autor__nombre_autor','autor2__nombre_autor','editorial__nombre_editorial','colección__nombre_colección','localización','título']


    autocomplete_fields = ["autor", "editorial","descriptores"]

    
    #Codigo sugerido por AmazonQ
    def get_search_results(self, request, queryset, search_term):
        search_terms = search_term.split()
        q_objects = []
        print(request.GET)
        
        #Busqueda por Número de registro
        if 'no_reg' in request.GET and request.GET['no_reg']:
            no_reg = request.GET['no_reg']
            q_objects.append(Q(no_reg__icontains=no_reg))
        
        if 'inputTitulo' in request.GET and request.GET['inputTitulo']:
            título = request.GET['inputTitulo']
            q_objects.append(Q(título__icontains=titulo))
            print(q_objects)

        # Search in the author fields
        if 'inputAutor' in request.GET and request.GET['inputAutor']:
            autor = request.GET['inputAutor']
            q_objects.append(Q(autor__nombre_autor__icontains=autor))
            print(q_objects)

        if 'inputDescriptor' in request.GET and request.GET['inputDescriptor']:
            descriptores = request.GET['inputDescriptor']
            q_objects.append(Q(descriptores__nombre_descriptor__icontains=descritpores))
            print(q_objects)

        if 'inputResumen' in request.GET and request.GET['inputResumen']:
            resumen = request.GET['inputResumen']
            q_objects.append(Q(resumen__icontains=resumen))
            print(q_objects)

        # Search in the editorial (publisher) field
        if 'inputEditorial' in request.GET and request.GET['inputEditorial']:
            editorial = request.GET['inputEditorial']
            q_objects.append(Q(editorial__nombre_editorial__icontains=editorial))
            
        print(request.GET)

        
        
        if q_objects:
            qs = queryset.filter(reduce(lambda x, y: x | y, q_objects))
            print(q_objects)
        else:
            qs = queryset

        return qs, True

    list_display = ('no_reg','título','get_descriptores','get_autor','get_autor2','get_autor3','get_editorial','get_coleccion','fecha_registro','get_lugar_de_impresion','localización')

    # list_filter = [AutorFilter,EditorialFilter]
    list_per_page = 10


    


    def get_last_book_register(self):
        return OpacLibro.objects.all().aggregate(Max('no_reg'))['no_reg__max'] + 1

    def get_form(self, request, obj=None, **kwargs):
        form = super(LibroModelAdmin, self).get_form(request, obj, **kwargs)
        form.base_fields['no_reg'].initial = self.get_last_book_register()
        form.base_fields['signatura'].initial = str(self.get_last_book_register()) + "-"
        #form.base_fields['isbn'].initial = {'text-transform': 'uppercase'}
        return form

My problem is that when I enter a search term in no_reg as example, I do not see any results in the changelist, and when i place debug prints in the code, it says the request search terms are empty, and I see in the runserver logs that is not like that ie:

[17/Jul/2024 15:07:28] "GET /adminopac/opaclibro/?no_reg=1900&inputTitulo=&inputAutor=&inputEditorial=&inputDescriptor=&inputResumen= HTTP/1.1" 302 0

The other issue is that I see a redirection http status code 302, and when I fall back to the classic search of django it throws a 200 http status code, I previously tryied to use django-admin-search package but is asking for a mantainer, and only one input field worked.thanks in advance.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Problem customizing search_get_results() method in Django Admin page to get Custom Search

I have an app in Django and I would like to use this template:

{% load i18n static %}
{% if cl.search_fields %}
<div className="form-group">
  <div class="search-notes col-md-6 col-sm-12">Para busqueda de terminos exactos poner el texto entre comillas Ej  para editorial "VANGUARDIA PICTORICA" o en ISBN "978-959-7126-52-2"</div>
</div>

      <div class="for-group-container row"> 
       <div class="form-group col-md-3">
        <input type="text" name="no_reg" class="form-control" placeholder="Número de Registro" />
   <br>     
         <input type="text" name="inputTitulo" class="form-control" placeholder="Título" />
     <br>

          
     
    <br/>
     <input type="text" name="inputAutor" class="form-control" placeholder="Autor" />
    <br/>
    </div>      

    <div class="form-group col-md-3">
    <input type="text" name="inputEditorial" class="form-control" placeholder="Editorial" />
    <br/>

    <input type="text" name="inputDescriptor" class="form-control" placeholder="Descriptor" />
    <br/>

    <div class="form-group col-md-3">
    <input type="text" name="inputResumen" class="form-control" placeholder="Resumen" />
    <br/>

<input type="submit" value="{% translate 'Search' %}">

  </div>
{% if show_result_count %}
    <span class="small quiet">{% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}{{ is_popup_var }}=1{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)</span>
{% endif %}
{% for pair in cl.params.items %}
    {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}">{% endif %}
{% endfor %}
</div>
{% if cl.search_help_text %}
<br class="clear">
<div class="help" id="searchbar_helptext">{{ cl.search_help_text }}</div>
{% endif %}
</form></div>
{% endif %}

as to implement a custom search in the django admin page. My admin.py class whrere I would like to implement the custom search is as follows:

@admin.register(OpacLibro)
class LibroModelAdmin(admin.ModelAdmin):
#class LibroModelAdmin(DjangoQLSearchMixin,admin.ModelAdmin):

    form = LibroForm
    #search_form = LibroCustomSearchForm
    search_fields = ['no_reg','autor__nombre_autor','autor2__nombre_autor','editorial__nombre_editorial','colección__nombre_colección','localización','título']


    autocomplete_fields = ["autor", "editorial","descriptores"]

    
    #Codigo sugerido por AmazonQ
    def get_search_results(self, request, queryset, search_term):
        search_terms = search_term.split()
        q_objects = []
        print(request.GET)
        
        #Busqueda por Número de registro
        if 'no_reg' in request.GET and request.GET['no_reg']:
            no_reg = request.GET['no_reg']
            q_objects.append(Q(no_reg__icontains=no_reg))
        
        if 'inputTitulo' in request.GET and request.GET['inputTitulo']:
            título = request.GET['inputTitulo']
            q_objects.append(Q(título__icontains=titulo))
            print(q_objects)

        # Search in the author fields
        if 'inputAutor' in request.GET and request.GET['inputAutor']:
            autor = request.GET['inputAutor']
            q_objects.append(Q(autor__nombre_autor__icontains=autor))
            print(q_objects)

        if 'inputDescriptor' in request.GET and request.GET['inputDescriptor']:
            descriptores = request.GET['inputDescriptor']
            q_objects.append(Q(descriptores__nombre_descriptor__icontains=descritpores))
            print(q_objects)

        if 'inputResumen' in request.GET and request.GET['inputResumen']:
            resumen = request.GET['inputResumen']
            q_objects.append(Q(resumen__icontains=resumen))
            print(q_objects)

        # Search in the editorial (publisher) field
        if 'inputEditorial' in request.GET and request.GET['inputEditorial']:
            editorial = request.GET['inputEditorial']
            q_objects.append(Q(editorial__nombre_editorial__icontains=editorial))
            
        print(request.GET)

        
        
        if q_objects:
            qs = queryset.filter(reduce(lambda x, y: x | y, q_objects))
            print(q_objects)
        else:
            qs = queryset

        return qs, True

    list_display = ('no_reg','título','get_descriptores','get_autor','get_autor2','get_autor3','get_editorial','get_coleccion','fecha_registro','get_lugar_de_impresion','localización')

    # list_filter = [AutorFilter,EditorialFilter]
    list_per_page = 10


    


    def get_last_book_register(self):
        return OpacLibro.objects.all().aggregate(Max('no_reg'))['no_reg__max'] + 1

    def get_form(self, request, obj=None, **kwargs):
        form = super(LibroModelAdmin, self).get_form(request, obj, **kwargs)
        form.base_fields['no_reg'].initial = self.get_last_book_register()
        form.base_fields['signatura'].initial = str(self.get_last_book_register()) + "-"
        #form.base_fields['isbn'].initial = {'text-transform': 'uppercase'}
        return form

My problem is that when I enter a search term in no_reg as example, I do not see any results in the changelist, and when i place debug prints in the code, it says the request search terms are empty, and I see in the runserver logs that is not like that ie:

[17/Jul/2024 15:07:28] "GET /adminopac/opaclibro/?no_reg=1900&inputTitulo=&inputAutor=&inputEditorial=&inputDescriptor=&inputResumen= HTTP/1.1" 302 0

The other issue is that I see a redirection http status code 302, and when I fall back to the classic search of django it throws a 200 http status code, I previously tryied to use django-admin-search package but is asking for a mantainer, and only one input field worked.thanks in advance.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật