Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在下面的查询中获取大写的 values_list ?
dict(Territory.objects.values_list('name'.upper(),'code')) # in pseudocode
还是我需要做一个列表理解?
dict([(name.upper(), code.upper()) for name,code in Territory.objects.values_list('name','code')])