Created
September 4, 2014 14:54
-
-
Save petrjasek/784ed120096d9a223133 to your computer and use it in GitHub Desktop.
layers
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
def controller_layer(doc): | |
doc['ctr'] = 1 | |
yield doc | |
doc['ctr'] = 2 | |
return doc | |
def service_layer(doc): | |
doc['srv'] = 1 | |
yield doc | |
doc['srv'] = 2 | |
return doc | |
def data_layer(doc): | |
doc['data'] = 1 | |
yield doc | |
doc['data'] = 2 | |
return doc | |
x = {} | |
for doc in controller_layer(x): | |
for doc in service_layer(x): | |
for doc in data_layer(x): | |
print('save', doc) | |
print('done', x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment