add basic product search
This commit is contained in:
14
products/dbrouters.py
Normal file
14
products/dbrouters.py
Normal file
@ -0,0 +1,14 @@
|
||||
from products.models import Product
|
||||
|
||||
|
||||
class ProductDBRouter(object):
|
||||
|
||||
def db_for_read(self, model, **hints):
|
||||
if model == Product:
|
||||
return 'products'
|
||||
return None
|
||||
|
||||
def db_for_write(self, model, **hints):
|
||||
if model == Product:
|
||||
return 'products'
|
||||
return None
|
||||
Reference in New Issue
Block a user