Created
October 21, 2012 16:09
-
-
Save Natim/3927372 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
def create_data(self, model_name, data, data_id=None): | |
"""Create a data to a model_name.""" | |
if data_id: | |
data_doc = self.db[data_id] | |
else: | |
data_doc = { | |
'type': 'data', | |
'model_name': model_name, | |
} | |
data_doc['data'] = data | |
de | |
self.db[data_id] = data_doc | |
return self.db[data_id]['_id'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment