def _check_relation(self, relation):
        """Raise a `ValueError` if `relation` is not allowed among
        the possible values.
        """
        selection = [val[0] for val in self.selection]
        if relation not in selection:
            raise ValueError(
                ("The value '{value}' supplied doesn't match with the possible"
                 " values '{selection}' for the '{field_name}' field").format(
                     value=relation,
                     selection=selection,
                     field_name=self.name,
                 ))
        return relation
def _check_relation ( self , relation ) : selection = [ val [ 0 ] for val in self . selection ] if relation not in selection : raise ValueError ( ( "The value '{value}' supplied doesn't match with the possible" " values '{selection}' for the '{field_name}' field" ) . format ( value = relation , selection = selection , field_name = self . name , ) ) return relation
Raise a `ValueError` if `relation` is not allowed among
        the possible values.