[Answered ]-Django filter queryset for replacing charactors

1👍

Try this query:

from django.db.models import Func
self.queryset.objects.annotate(customer_phone=Func(F('phone'), Value('[^0-9]'), Value(''), Value('g'), function='REGEXP_REPLACE', output_field=models.CharField()))

Leave a comment