Re: audit trail functionality in database model

2017-01-26 Thread enrico baranski
@Fred: Thanks a lot, that really helped me! enrico -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this

Re: audit trail functionality in database model

2017-01-23 Thread Ryan Castner
Django Field History is a great project to audit trail a model field On Saturday, January 21, 2017 at 7:19:57 AM UTC-5, enrico baranski wrote: > > Hi all Django users, > > I'm quite new to Django and currently experimenting with the database > model. Defining fields appears to be quite intuitive

Re: audit trail functionality in database model

2017-01-23 Thread Melvyn Sopacua
On Saturday 21 January 2017 04:15:34 enrico baranski wrote: > I'm quite new to Django and currently experimenting with the database > model. Defining fields appears to be quite intuitive and is well > described in the documentation. However, I am looking into audit > trail functionalities.

Re: audit trail functionality in database model

2017-01-22 Thread Fred Stluka
Enrico, In the sample MySQL trigger code of my previous message, you'll see that I always store, in the primary table, the string username of the most recent user to update the table.  Therefore, that value is available to the DB trigger as NEW.update_user.

Re: audit trail functionality in database model

2017-01-22 Thread Fred Stluka
Enrico, the DB trigger approach sounds very exciting to me because I really need to be sure that there is no way to manipulate records without audit trail. I also would be very interested in the trigger code for MySQL you mentioned. OK.  I'll append

Re: audit trail functionality in database model

2017-01-22 Thread enrico baranski
Thinking about this topic more detailed made me realize that I also need to track the user who performed the insert/change (delete is globally not permitted) actions. However, that are user names managed via Django ... so when i use DB triggers I only can track the MySQL user who is used by the

Re: audit trail functionality in database model

2017-01-22 Thread enrico baranski
Hi Fed, the DB trigger approach sounds very exciting to me because I really need to be sure that there is no way to manipulate records without audit trail. I also would be very interested in the trigger code for MySQL you mentioned. You also mentioned that you did something similar in the

Re: audit trail functionality in database model

2017-01-22 Thread enrico baranski
Hi Mike, thanks for that reference, I will take a look. Enrico -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To

Re: audit trail functionality in database model

2017-01-21 Thread Fred Stluka
Enrico, I've done this in the past.  I didn't use Django directly for the audit tables.  Instead I defined DB triggers on each primary table that inserted a row of audit values into the audit table.  I can send you sample trigger code that works in Oracle and

Re: audit trail functionality in database model

2017-01-21 Thread Mike Dewhirst
You could have a look at Marty Alchin's Pro Django (not really for beginners but ...) on page 263 where he shows how to do almost exactly what you describe. If you got that book it would accelerate your progress in Django anyway. The only downside is it was published in 2008 and Django has

audit trail functionality in database model

2017-01-21 Thread enrico baranski
Hi all Django users, I'm quite new to Django and currently experimenting with the database model. Defining fields appears to be quite intuitive and is well described in the documentation. However, I am looking into audit trail functionalities. What that means to me. I have two tables, one is