Example #1
0
 def get(cls):
     return {"posts": post_schema_list.dump(PostModel.find_all())}, 200
Example #2
0
 def get(cls, user_id: int):
     return {"posts": post_schema_list.dump(PostModel.find_all(user_id))}
Example #3
0
 def get(self):
     return [{"id": post.id,
              "text": post.text,
              "id_user": post.id_user,
              "date_created": post.date_created.strftime('%Y-%m-%d %H:%M')}
             for post in PostModel.find_all()], 200
Example #4
0
 def get(self):
     return {'posts': [post.json() for post in PostModel.find_all()]}