def log_element(elem, request):
    transaction = Transaction(user=request.user)
    transaction.save()
    elem.save()
    elem.log_add(transaction)
def log_element(elem, request):
    transaction = Transaction(user=request.user)
    transaction.save()
    elem.save()
    elem.log_add(transaction)