Question:
I imported a model(named Feature) and set it to a list in Djangoprint(posts[5])
this displays apple in shell which is the 5th object
however on checking it with a if condition it returns falseAnswer:
'apple'
is a string object. posts
is not a list
but QuerySet
object of Feature
objects.
It will never find object of other type ๐You have to seek
Feature
objects like that, in example:yes
.PS If name is going to be
unique
you can add unique=True
to the model.If you have better answer, please add a comment about this, thank you!