def _modifyEnt(self, ent):
    old_pk = ent.pk
    new_pk = ent[ent.__class__.pk][0]
    if (new_pk != old_pk):
        ent.pk = new_pk
        if (new_pk in ent.objects):
            raise RuntimeError
        else:
            del ent.objects[old_pk]
    ent.save()
def _modifyEnt(self, ent):
    old_pk = ent.pk
    new_pk = ent[ent.__class__.pk][0]
    if (new_pk != old_pk):
        ent.pk = new_pk
        if (new_pk in ent.objects):
            raise RuntimeError
        else:
            del ent.objects[old_pk]
    ent.save()