'Save the state of the Constraint for pickling.
Fields aren\'t necessarily pickleable, because they can have
callable default values. So, instead of pickling the field
store a reference so we can restore it manually'

def __getstate__(self):

    obj_dict = self.__dict__.copy()
    if self.field:
        obj_dict['model'] = self.field.model
        obj_dict['field_name'] = self.field.name
    del obj_dict['field']
    return obj_dict
