Created
March 6, 2012 22:13
-
-
Save douglasmiranda/1989346 to your computer and use it in GitHub Desktop.
Django: extract pks from a db object in to a list of integers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_pks(objects): | |
return [int(value.get('pk')) for value in objects.values('pk')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment