Пример #1
0
 def save(self):
     """save(void) -> return(None)
     Returns :None
     Store the json representive of the data to mongo
     """
     db.insert('posts', self.json()) # insert json in the post table
Пример #2
0
 def save(self):
     """
     Saves the user details
     """
     db.insert('users', self.get_json())
Пример #3
0
 def save(self):
     """Save whatever post created by the user to the blog database.
     The post is saved in json format and it includes the author,
     the author id, the title, the description and the post id.
     """
     return db.insert('blogs', self.json())