#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Date: 2019/3/6


class MasterSlaveDBRouter(object):
    """数据库主从读写分离路由"""

    def db_for_read(self, model, **hints):
        """读数据库"""
        return "slave"

    def db_for_write(self, model, **hints):
        """写数据库"""
        return "default"
