'Saves selected object permissions by creating new ones and removing
those which were not selected but already exists.
Should be called *after* form is validated.'

def save_obj_perms(self):

    perms = self.cleaned_data[self.get_obj_perms_field_name()]
    model_perms = [c[0] for c in self.get_obj_perms_field_choices()]
    to_remove = (set(model_perms) - set(perms))
    for perm in to_remove:
        remove_perm(perm, self.group, self.obj)
    for perm in perms:
        assign_perm(perm, self.group, self.obj)
