Ejemplo n.º 1
0
def callback_delete(sender, **kwargs):
    post_delete.disconnect(callback_delete)
    try:
        mo = ModelsOperation()
        mo.model_class = sender.__name__
        mo.operation = 'Deletion'
        mo.save()
    except:
        pass
    post_delete.connect(callback_delete)
Ejemplo n.º 2
0
def callback_save(sender, **kwargs):
    post_save.disconnect(callback_save)
    try:
        mo = ModelsOperation()
        mo.model_class = sender.__name__
        if kwargs['created']:
            mo.operation = 'Creation'
        else:
            mo.operation = 'Editing'
        mo.save()
    except:
        pass
    post_save.connect(callback_save)