# Path: maple/blog/db.py
# class TimeLine(db.Model, ModelUserMixin):
#     __tablename__ = 'timeline'
# 
#     id = db.Column(db.Integer, primary_key=True)
#     content = db.Column(db.Text, nullable=False)
#     is_hidden = db.Column(db.Boolean, nullable=True, default=False)
# 
#     __mapper_args__ = {"order_by": text("created_at desc")}
# 
#     def __repr__(self):
#         return "<TimeLine %r>" % self.content[:10]
# 
#     def __str__(self):
#         return self.content[:10]
# 
#     @property
#     def datetime_format(self):
#         return format_datetime(self.created_at, 'Y-M-d H:M')
# 
#     def to_json(self):
#         return {'id': self.id, 'content': self.content, 'hide': self.hide}


from flask_maple.response import HTTP
from flask_maple.serializer import Serializer
from flask_maple.views import MethodView
from maple.blog.db import TimeLine
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ********************************************************************************
# Copyright © 2019 jianglin
# File Name: timeline.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2019-05-24 22:49:44 (CST)
# Last Update: Friday 2019-05-24 22:56:43 (CST)
#          By:
# Description:
# ********************************************************************************



class TimeLineAPI(MethodView):
    def get(self):
        page, number = self.pageinfo
        filter_dict = {'is_hidden': False}
        order_by = ('-created_at', )

# Path: maple/blog/db.py
# class TimeLine(db.Model, ModelUserMixin):
#     __tablename__ = 'timeline'
# 
#     id = db.Column(db.Integer, primary_key=True)
#     content = db.Column(db.Text, nullable=False)
#     is_hidden = db.Column(db.Boolean, nullable=True, default=False)
# 
#     __mapper_args__ = {"order_by": text("created_at desc")}
# 
#     def __repr__(self):
#         return "<TimeLine %r>" % self.content[:10]
# 
#     def __str__(self):
#         return self.content[:10]
# 
#     @property
#     def datetime_format(self):
#         return format_datetime(self.created_at, 'Y-M-d H:M')
# 
#     def to_json(self):
#         return {'id': self.id, 'content': self.content, 'hide': self.hide}


# Path: maple/blog/api/timeline.py
from flask_maple.response import HTTP
from flask_maple.serializer import Serializer
from flask_maple.views import MethodView
from maple.blog.db import TimeLine

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ********************************************************************************
# Copyright © 2019 jianglin
# File Name: timeline.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2019-05-24 22:49:44 (CST)
# Last Update: Friday 2019-05-24 22:56:43 (CST)
#          By:
# Description:
# ********************************************************************************



class TimeLineAPI(MethodView):
    def get(self):
        page, number = self.pageinfo
        filter_dict = {'is_hidden': False}
        order_by = ('-created_at', )

        timelines = TimeLine.query.filter_by(