Hello,
i'm trying to get a dict of emails with usernames as keys.
User.objects.filter(username__in=['foo', 'bar']).values('username', 'email')
The above returns a list of dicts:
[{'username': 'foo', 'email': '[EMAIL PROTECTED]'},
{'username': 'bar', 'email': '[EMAIL PROTECTED]'}]
Is it possible to get a dict like this with Django's db api?:
{'foo':'[EMAIL PROTECTED]', 'bar':'[EMAIL PROTECTED]'}
Best Regards,
Dirk Eschler
--
Dirk Eschler <mailto:[EMAIL PROTECTED]>
http://www.krusader.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---