Skip to content

Commit

Permalink
Adding support for the changed 'state' column in the querybuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannipizzi committed Mar 21, 2017
1 parent e162de6 commit 7f6e80e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aiida/backends/sqlalchemy/querybuilder_sqla.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.sql.elements import Cast
from sqlalchemy.sql.elements import Cast, Label
from sqlalchemy_utils.types.choice import Choice

from aiida.common.exceptions import (
Expand Down Expand Up @@ -316,7 +316,9 @@ def get_filter_expr(

def _get_filter_expr_from_column(self, operator, value, column):

if not isinstance(column, (Cast, InstrumentedAttribute)):
# Label is used because is what is returned for the
# 'state' column by the hybrid_column
if not isinstance(column, (Cast, InstrumentedAttribute, Label)):
raise TypeError(
'column ({}) {} is not a valid column'.format(
type(column), column
Expand Down

0 comments on commit 7f6e80e

Please sign in to comment.