예제 #1
0
파일: list.py 프로젝트: Toshakins/querylist
    def _check_element(self, lookup_strings, instance):
        """Return True if lookup string/value pairs match against the passed
        object.

        """
        for q, val in lookup_strings.items():
            if not field_lookup(instance, q, val, True):
                return False

        return True
예제 #2
0
파일: list.py 프로젝트: garykrige/querylist
    def _check_element(self, lookup_strings, instance):
        """Return True if lookup string/value pairs match against the passed
        object.

        """
        for q, val in lookup_strings.items():
            if not field_lookup(instance, q, val, True):
                return False

        return True
예제 #3
0
 def test_compares_based_on_comparator_specified_in_lookup_string(self):
     self.assertEqual(
         field_lookup(self.instance, 'sauce__iexact', 'mustard', True),
         True
     )
예제 #4
0
 def test_returns_comparison_result_when_compare_is_set_to_true(self):
     self.assertEqual(
         field_lookup(self.instance, 'foo', 1, True), True)
예제 #5
0
 def test_returns_looked_up_value_when_passed_a_lookup_and_instance(self):
     self.assertEqual(
         field_lookup(self.instance, 'bar__meh__bleh'), [1, 2])
예제 #6
0
 def test_compares_based_on_comparator_specified_in_lookup_string(self):
     self.assertEqual(
         field_lookup(self.instance, 'sauce__iexact', 'mustard', True),
         True)
예제 #7
0
 def test_returns_comparison_result_when_compare_is_set_to_true(self):
     self.assertEqual(field_lookup(self.instance, 'foo', 1, True), True)
예제 #8
0
 def test_returns_looked_up_value_when_passed_a_lookup_and_instance(self):
     self.assertEqual(field_lookup(self.instance, 'bar__meh__bleh'), [1, 2])