it’s simple to use(take flask-sqlalchemy as an example)
posts = Post.query.all()
serializer = Serializer(posts)
data = serializer.datapost = Post.query.first()
serializer = Serializer(post)
data = serializer.dataserializer = Serializer(post,exclude=['title'])serializer = Serializer(post,include=['title'])serializer = Serializer(post,depth=3)- depth default:2
serializer = Serializer(post,extra=['get_post_count'])Post
class Post(Model):
    ......
    def get_post_count(self):
        return 11class PostSerializer(Serializer):
    count = Field(source = 'get_post_count',args={'name':'hello'},default=20)
    class Meta:
        include = []
        depth = 2
        include = []
        exclude = []
        extra = ['count']- gt
- lt
- lte
- gte
- contains
- in
- exact
- iexact
- startswith
- istartswith
- iendswith
- endswith
- isnull
- range
- year
- month
- day
Example:
Post.query.filter_by(title__contains = 'sql').all()
Post.query.exclude_by(title__contains = 'sql').all()Post.query.filter_by(tags__name__contains = 'sql').all()Post.query.filter_by(tags__name__contains = 'sql').or(Post.id == 1,Post.id == 2).all()
Post.query.filter_by(tags__name__contains = 'sql').and(Post.id == 1,Post.id == 2).all()
Post.query.filter_by(tags__name__contains = 'sql').exists()
Post.query.load_only('title')take flask-sqlalchemy as an example,you can remove part of the repetitive work by use Mixin of ‘models.py’
Increment ID – id
post = Post(·····)
post.save() 
post.delete()bulk operation
- bulk_insert
- bulk_update
- bulk_save
- created_at Data create time
- updated_at Data update time
relate to *User*(many to one)
class Post(ModelUserMixin, Model):
    user_related_name = 'posts'
    titile = ...