<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check(self, defn):
 """Performs the uniqueness check against the value list maintained in this rule objects """

        val = getattr(defn, self.attr)
        if val is not None and val in self.val_list:
            self.messages.append(self.msg % str(val))
            # TODO self.messages.append("TBD location message")
            self.valid = False
        elif val is not None:
            self.val_list.append(val)
            log.debug(self.val_list)