コード例 #1
0
 def get_variables_filter(self,
                          gender=None,
                          name1=None,
                          value1=None,
                          name2=None,
                          value2=None,
                          var=None):
     #db.jerboa_files.distinct( 'values.Var' )
     values = jerboa_collection.distinct('values.' + param)
     return values
コード例 #2
0
    def get_var(self):
        values = jerboa_collection.distinct('values.Var')
        # Go to the rule matcher and ask for the filter for that particular case
        comp = False
        if fingerprint_id == "COMPARE":
            comp = True
        mrules = RuleMatcher(comp=comp)
        filters = mrules.get_filter(var)
        chart = mrules.get_chart(var)

        # Generate the filters here.
        for _filter in filters:

            # Generate query

            dict_query = {
                'fingerprint_id': fingerprint_id,
                'values.Var': chart.title.var,
            }
            if comp:
                dict_query = {
                    'values.Var': chart.title.var,
                }
            if _filter.key != None:
                dict_query['values.' + _filter.key] = _filter.name

        if comp:
            values = jerboa_aggregation_collection.find(dict_query).distinct(
                'values.' + _filter.value)  #
        else:
            values = jerboa_collection.find(dict_query).distinct(
                'values.' + _filter.value)  #

        values = sorted(values)

        _filter.values = values

        return filters
        return values
コード例 #3
0
ファイル: services.py プロジェクト: bastiao/catalogue
    def get_var(self):
        values =  jerboa_collection.distinct( 'values.Var' )
        # Go to the rule matcher and ask for the filter for that particular case
        comp = False
        if fingerprint_id=="COMPARE":
            comp=True
        mrules = RuleMatcher(comp=comp)
        filters = mrules.get_filter(var)
        chart = mrules.get_chart(var)


        # Generate the filters here.
        for _filter in filters:

            # Generate query

            dict_query = {'fingerprint_id':fingerprint_id,
                'values.Var': chart.title.var,

                }
            if comp:
                dict_query = {'values.Var': chart.title.var,}
            if _filter.key != None:
                dict_query['values.' + _filter.key]  = _filter.name


        if comp:
            values =  jerboa_aggregation_collection.find( dict_query ).distinct('values.' + _filter.value )#
        else:
            values =  jerboa_collection.find( dict_query ).distinct('values.' + _filter.value )#

        values = sorted(values)

        _filter.values = values
        return filters
        return values
コード例 #4
0
ファイル: services.py プロジェクト: bastiao/catalogue
 def get_variables_filter(self, gender=None, name1=None, value1=None, name2=None,
     value2=None, var=None):
     #db.jerboa_files.distinct( 'values.Var' )
     values =  jerboa_collection.distinct( 'values.' +  param )
     return values