I think the API here is wrong. You should pass in the received and from number when creating the message. Also rather than having a set_directory method (which is confusing anyway as it doesn't), you can just do message.directory = "blah" to set the directory . Then you can define the file as a property and calculate it's value on the fly (so it will be consistent with the underlying data), i.e.

    @property
    def file(self):
        return os.path.join(self.directory, "%s_%s.%s" % (self.received, self.from_number, RECORD_FORMAT))