6👍
✅
Try using a less strict filter, like __contains:
elif val2=='Name':
newData = EmployeeDetails.objects.filter(userName__contains=val3)
flag=True
Docs: http://docs.djangoproject.com/en/dev/ref/models/querysets/#contains
7👍
You can use contains
query e.g.
Entry.objects.get(headline__contains='Lennon')
See http://docs.djangoproject.com/en/dev/ref/models/querysets/#contains
There are other options too like startswith, endswith, and you can do even regex search on most databases.
- [Django]-Django adding a feedback form on every page
- [Django]-Django-compressor + less compress the files but link to original files
- [Django]-Populate() isn't reentrant Django Google App Engine
- [Django]-How do i make a functioning Delete confirmation popup in Django using Bootstrap4 Modal
1👍
Probably field lookups will help you here. It lets to filter by beginning of the word, containing word and so on.
- [Django]-Django Caching – How do I set up my code to avoid duplicating cache logic?
- [Django]-How to add a new instance of Django model with FileField by ModelForm?
Source:stackexchange.com