Filtertion in database with django

I have a product in database whose name is - TUBE-LIGHT23. now how do i get this object by name = TUBELIG3.

13th Jul 2017, 6:55 AM
Tapish kanodia
Tapish kanodia - avatar
1 Answer
If I got your question right, you are probably looking for something like __contains : product = Product.objects.filter(name__contains='TUBELIG3') Hope that's helpful!
16th Jun 2021, 9:33 AM
Fu Foy
Fu Foy - avatar