<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(self, hcont, value, score = None):
 """ If sort_field is specified, score must be None. If sort_field is not specified, score is mandatory. """

        assert (score is None) != (self.field.sort_field is None)
        if score is None:
            score = getattr(value, self.field.sort_field.name)
        ContainerFieldWriter.append(self, hcont, value, score)