You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
374 B
16 lines
374 B
#!/usr/bin/env python
|
|
# -*- coding:utf-8 -*-
|
|
# author: NinEveN
|
|
# date: 2022/2/14
|
|
|
|
class DBRouter(object):
|
|
def db_for_read(self, model, **hints):
|
|
#
|
|
# if model._meta.model_name == 'Price':
|
|
# return 'db1'
|
|
# else:
|
|
# return 'default'
|
|
return 'slave'
|
|
|
|
def db_for_write(self, model, **hints):
|
|
return 'default'
|
|
|