Exemplo n.º 1
0
from model.blog import Blog
from database import Database

Database.initialize()

blog = Blog(author= "adarsh",
            title = "Sample title",
            description="Sample Description")

blog.new_post()

blog.save_to_mongo()

from_database = Blog.from_mongo(blog.id)

print(blog.get_post())

Exemplo n.º 2
0
 def _prompt_user_for_account(self):
     title = input("enter blog author")
     description = input("enter blog description")
     blog = Blog(author=self.user, title=title, description=description)
     blog.save_to_mongo()