python - List indices must be integers on two dictionaries -


    ret = {}     machs = self.machines_db(**kwargs)      mach in machs:         ret[mach['name']] = mach 

machs list of dictionaries, , each dictionary contains 'name' element.

so, ret , mach both dictionaries. why getting:

list indices must integers, not str

on last line when try run code? other questions i've turned error message have had list being queried string.

thank you!


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -