add basic product search

This commit is contained in:
Seth Ladygo
2019-05-13 18:59:13 -07:00
parent e902aa524a
commit 3990774de3
8 changed files with 185 additions and 0 deletions

14
products/dbrouters.py Normal file
View 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