__author__="hmorrin"
from database import Database

class Post(object):
    def __init__(self,blog_id,title,content,author,id):
        self.title=title
        self.content=content
        self.author=author
        self.id = id


    def save_to_db(self):
        Database.insert(table_name="posts", data=self.json())

    @staticmethod
    def retrieve_from_db(id):
        data= Database.find_one(table_name="posts",query={"id":id})

    def json(self):
        return {
            "id":self.id,
            "blog_id":self.author,
            "content":self.content,
            "title":self.title,
            "created_date":self.created_date
        }

7ed66de75ae453748307b1fd3020e748c2f92eba
<mask token>


class Post(object):
    <mask token>

    def save_to_db(self):
        Database.insert(table_name='posts', data=self.json())

    @staticmethod
    def retrieve_from_db(id):
        data = Database.find_one(table_name='posts', query={'id': id})

    def json(self):
        return {'id': self.id, 'blog_id': self.author, 'content': self.
            content, 'title': self.title, 'created_date': self.created_date}

<mask token>


class Post(object):

    def __init__(self, blog_id, title, content, author, id):
        self.title = title
        self.content = content
        self.author = author
        self.id = id

    def save_to_db(self):
        Database.insert(table_name='posts', data=self.json())

    @staticmethod
    def retrieve_from_db(id):
        data = Database.find_one(table_name='posts', query={'id': id})

    def json(self):
        return {'id': self.id, 'blog_id': self.author, 'content': self.
            content, 'title': self.title, 'created_date': self.created_date}

__author__ = 'hmorrin'
<mask token>


class Post(object):

    def __init__(self, blog_id, title, content, author, id):
        self.title = title
        self.content = content
        self.author = author
        self.id = id

    def save_to_db(self):
        Database.insert(table_name='posts', data=self.json())

    @staticmethod
    def retrieve_from_db(id):
        data = Database.find_one(table_name='posts', query={'id': id})

    def json(self):
        return {'id': self.id, 'blog_id': self.author, 'content': self.
            content, 'title': self.title, 'created_date': self.created_date}

__author__ = 'hmorrin'
from database import Database


class Post(object):

    def __init__(self, blog_id, title, content, author, id):
        self.title = title
        self.content = content
        self.author = author
        self.id = id

    def save_to_db(self):
        Database.insert(table_name='posts', data=self.json())

    @staticmethod
    def retrieve_from_db(id):
        data = Database.find_one(table_name='posts', query={'id': id})

    def json(self):
        return {'id': self.id, 'blog_id': self.author, 'content': self.
            content, 'title': self.title, 'created_date': self.created_date}

__author__="hmorrin"
from database import Database

class Post(object):
    def __init__(self,blog_id,title,content,author,id):
        self.title=title
        self.content=content
        self.author=author
        self.id = id


    def save_to_db(self):
        Database.insert(table_name="posts", data=self.json())

    @staticmethod
    def retrieve_from_db(id):
        data= Database.find_one(table_name="posts",query={"id":id})

    def json(self):
        return {
            "id":self.id,
            "blog_id":self.author,
            "content":self.content,
            "title":self.title,
            "created_date":self.created_date
        }
