Fix missing import bug.
This commit is contained in:
parent
e2131d3500
commit
fca1ae55db
|
@ -29,6 +29,7 @@ from __future__ import unicode_literals
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
from sqlalchemy.orm import joinedload, aliased
|
from sqlalchemy.orm import joinedload, aliased
|
||||||
|
@ -354,7 +355,7 @@ class ProductsAutocomplete(AutocompleteView):
|
||||||
|
|
||||||
def query(self, term):
|
def query(self, term):
|
||||||
q = Session.query(model.Product).outerjoin(model.Brand)
|
q = Session.query(model.Product).outerjoin(model.Brand)
|
||||||
q = q.filter(or_(
|
q = q.filter(sa.or_(
|
||||||
model.Brand.name.ilike('%{0}%'.format(term)),
|
model.Brand.name.ilike('%{0}%'.format(term)),
|
||||||
model.Product.description.ilike('%{0}%'.format(term))))
|
model.Product.description.ilike('%{0}%'.format(term))))
|
||||||
if not self.request.has_perm('products.view_deleted'):
|
if not self.request.has_perm('products.view_deleted'):
|
||||||
|
|
Loading…
Reference in a new issue