def get_posts():
    query = [i.__dict__ for i in PostItem.query.all()]
    for item in query:
        del item['_sa_instance_state']
    return query
def get_posts():
    query = [i.__dict__ for i in PostItem.query.all()]
    for item in query:
        del item['_sa_instance_state']
    return query