Last active
December 11, 2015 19:29
-
-
Save trevershick/4648928 to your computer and use it in GitHub Desktop.
Simple Python List Comprehension Example
This file contains hidden or 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
| >>> [ (e.id, e.title) for e in Entry.objects.all() if e.status == Entry.STATUS_LIVE ] | |
| [(5, u'Test Entry 2'), (3, u'Test Title 0')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment