Skip to content

Instantly share code, notes, and snippets.

@fredrikbonander
Created August 20, 2013 19:20
Show Gist options
  • Save fredrikbonander/6285962 to your computer and use it in GitHub Desktop.
Save fredrikbonander/6285962 to your computer and use it in GitHub Desktop.
Fetch all Issue by assingment
## First fetch all assingments
qp = QueryParser({'assigned_to': [('=', account_id)]})
assignments = IssueAssignFactory.fetch(filters=qp.filters).resolve() # Do later, just for show
## Make new IssueAssignFactory.fetch that only fetch keys
# Alt 1
issues = ndb.get_multi([assignment.key().parent() for assignment in assignments])
# Alt 2, bad idea i think
qp = QueryParser({'key': [('=', [assignment.key().parent() for assignment in assignments])]})
issues = IssueFactory().fetch(filters=qp.filters).resolve() # Do later, just for show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment