code: def add_constraint(self, op, val):
          
          if len(self.constraints) > 0:
              if op.is_equality():
                  clist = ', '.join(map(str, self.constraints))
                  raise ValueError('Field {}: equality operator cannot be combined '
                                   'with others: {}'.format(self._field.name, clist))
              elif op.is_exists():
                  raise ValueError('Field {}: existence is implied '
                                   'by other operators'.format(self._field.name))
          constraint = Constraint(self._field, op, val)
          self.constraints.append(constraint)
          if self._field.has_subfield():
              self._array = True
          elif op.is_inequality():
              self._range = True
docs: Add new constraint.
  
          :param op: Constraint operator
          :type op: ConstraintOperator
          :param val: Constraint value
          :type val: str,Number
          :raise: ValueError if combination of constraints is illegal