Issue
what is diffrent between title and title_icontains in django ?
from .model import product
product.objects.filter(title='blah')
product.objects.filter(tite__icontains='blah')
Solution
The first form ...filter(title='value')
will return all objects whose title will match exactly the value.
And the second form, correctly written as ...filter(title__icontains)
will return all objects whose title contains the value, but any upper/lower case letters will match.
The i
here means "ignore case".
Answered By - Florin C.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.