15 lines
404 B
Python
15 lines
404 B
Python
from products.models import Product, SeasonRegionMaterial
|
|
|
|
|
|
class ProductDBRouter(object):
|
|
|
|
def db_for_read(self, model, **hints):
|
|
if model == Product or model == SeasonRegionMaterial:
|
|
return 'products'
|
|
return None
|
|
|
|
def db_for_write(self, model, **hints):
|
|
if model == Product or model == SeasonRegionMaterial:
|
|
return 'products'
|
|
return None
|