Last active
January 17, 2017 15:29
-
-
Save hansonkd/ad180c813ae5beafbef0cc6d4f652594 to your computer and use it in GitHub Desktop.
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
all_securities = Security.objects.filter(company=company).for_report().iterator() | |
class FlatData(object): | |
pass | |
def add_issue_date((flat, mdl)): | |
flat.issue_date = mdl.get_issue_date() | |
return (flat, mdl) | |
def add_label((flat, mdl)): | |
flat.name = mdl.get_label() | |
return (flat, mdl) | |
flat_securities = ( | |
conduit(all_securities) | |
... | |
.map(lambda security: (FlatData(), security)) | |
.map( | |
compose( | |
add_issue_date, | |
add_label, | |
) | |
) | |
.map(lambda (flat, security): flat) | |
... | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment