ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #96: ARIA-137-Support-for-predicate-based-q...
Date Wed, 05 Apr 2017 11:27:05 GMT
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/96#discussion_r109890955
  
    --- Diff: aria/storage/sql_mapi.py ---
    @@ -243,7 +250,10 @@ def _filter_query(self, query, filters):
         @staticmethod
         def _add_value_filter(query, filters):
             for column, value in filters.items():
    -            if isinstance(value, (list, tuple)):
    +            if isinstance(value, dict):
    +                for predicate, operand in value.items():
    +                    query = query.filter(getattr(column, predicate)(operand))
    --- End diff --
    
    well, SQL makes it fairly simple. as in `value > other_value`. but propagating it to
the query is messy...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message