0

The following works for me --

email_list = EmailList.objects.get(domain=(cd['email'].split('@')[1]))

But defining the 'domain' variable before does not --

domain = cd['email'].split('@')[1]
email_list = EmailList.objects.get(domain=domain)

When I do the latter, it raises an "EmailList matching query does not exist". What accounts for this difference??

1 Answer 1

2

There is nothing that accounts for this difference; Python variables do not change type when bound to a name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.