'Restore the constraint'

def __setstate__(self, data):

    model = data.pop('model', None)
    field_name = data.pop('field_name', None)
    self.__dict__.update(data)
    if (model is not None):
        self.field = model._meta.get_field(field_name)
    else:
        self.field = None
