Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

331
Views
Parámetro 'inferior' del administrador de objetos de Django

Estoy tratando de filtrar un conjunto de consultas en función de si uno de sus nombres de campo está en una lista de valores en minúsculas. El problema es que algunos de estos valores de campo tienen letras mayúsculas, por lo que no puedo hacer

 all_listings = all_listings.objects.filter(make__name__in=makes)

¿Hay alguna manera posible de decir algo en la línea de

 all_listings = all_listings.objects.filter(make__name__lower__in=makes)
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puedes intentar usar la función inferior

 from django.db.models.functions import Lower all_listings = all_listings.objects.annotate(name_lower=Lower('make__name')).filter(name_lower__in=makes)
over 4 years ago · Santiago Trujillo Report

0

Tu puedes hacer

 all_listings = all_listings.objects.filter(make__name__iregex=r'(' + '|'.join(makes) + ')')
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!