you are looking for `statedict.items()`. (Or `statedict.iteritems()` on py2) By default a dict just loops over the keys. And then it unpacks your two letter string into k, v. So the first step of your loop is k='A' and v='K'.
On 12/16/2016 4:19 PM, Malik Rumi wrote:
naively thinking I would be able to do something like
for k,v in statedict:
if twodigit == k:
state = Jurisdiction.objects.get(v)
No comments:
Post a Comment