12-27-2017 12:59 PM
I have this code that when execute all tenants print out line by line including 'Production' but when check for t == 'Production' it is not true
tenants = Tenant.get(session)
for t in tenants:
print t
if t == 'Production': #why this line is never true?
print "TRUE"
Solved! Go to Solution.
02-11-2018 08:52 PM
The instance tenant has an object called name.
So, your code should basically be like this.
tenants = Tenant.get(session)
for t in tenants:
print t
if t.name == 'Production':
print "TRUE"
I hope this helps.
02-11-2018 08:52 PM
The instance tenant has an object called name.
So, your code should basically be like this.
tenants = Tenant.get(session)
for t in tenants:
print t
if t.name == 'Production':
print "TRUE"
I hope this helps.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide