Does this:
if key == \"name\" and item:
mean the same as this:
if key == \"name\" and if key == \"item\":
If, hypothetically, you did want
if key == "name" and if key == item:
you could do this
if key == "name" == item: