Use boolean search filter for batch column filters of 'FLAG' type.
This commit is contained in:
parent
9e6b02bcc8
commit
4a71ab5fb1
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2012 Lance Edgar
|
# Copyright © 2010-2014 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -21,17 +20,20 @@
|
||||||
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Batch Row Views
|
Batch Row Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .. import SearchableAlchemyGridView, CrudView
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from pyramid.httpexceptions import HTTPFound
|
from pyramid.httpexceptions import HTTPFound
|
||||||
|
|
||||||
from ...db import Session
|
from tailbone.views import SearchableAlchemyGridView, CrudView
|
||||||
|
from tailbone.forms import GPCFieldRenderer
|
||||||
|
from tailbone.grids.search import BooleanSearchFilter
|
||||||
|
from tailbone.db import Session
|
||||||
|
|
||||||
from rattail.db.model import Batch, LabelProfile
|
from rattail.db.model import Batch, LabelProfile
|
||||||
from ...forms import GPCFieldRenderer
|
|
||||||
|
|
||||||
|
|
||||||
def field_with_renderer(field, column):
|
def field_with_renderer(field, column):
|
||||||
|
@ -76,6 +78,8 @@ def BatchRowsGrid(request):
|
||||||
for column in batch.columns:
|
for column in batch.columns:
|
||||||
if column.visible:
|
if column.visible:
|
||||||
config['filter_label_%s' % column.name] = column.display_name
|
config['filter_label_%s' % column.name] = column.display_name
|
||||||
|
if column.data_type == 'FLAG(1)':
|
||||||
|
config['filter_factory_{0}'.format(column.name)] = BooleanSearchFilter
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def grid(self):
|
def grid(self):
|
||||||
|
|
Loading…
Reference in a new issue