I need to search for users table filtering by first name or last name.
Given a user John Doe Smith, where John is the First Name and Doe Smith is the Last Name.
When I search for John Smith, it should find the user above.
I know that its just a matter of implementing the solution of this SO answer, but how I do that in django-filter
and keep other Filter Fields like email
or phone
also ?
patient.py
(Only the relevant part)
class Patient(TimeStampedModel):
name = models.CharField('Name', max_length=30)
last_name = models.CharField('Last Name', max_length=30)
phone = models.CharField('Phone', max_length=14)