Re: creating a website log

2007-03-19 Thread David Larlet
2007/3/6, limodou <[EMAIL PROTECTED]>: > > I think signals will be easier, if you also want to record delete > information of a record, you can also hook pre_delete, the pseudo code > is: > > from django.db.models import signals > > def pre_save(sender, instance, signal, *args, **kwargs): > if

Re: creating a website log

2007-03-07 Thread Patrick
Thanks! Looks interesting. I was thinking of creating a ActionLog-like model and storing the log in db instead of a log file. On Mon, 05 Mar 2007 18:41:30 -0800, Rubic wrote: > My solution is this: I've ripped out some stuff from the old admin code > and written AppLogModel with three method

Re: creating a website log

2007-03-05 Thread Rubic
If the goal is to write the actions to a log file, limodou's recommendation for using signals is easier to implement. I'm more or less duplicating the admin approach in my application. -- Jeff Bauer Rubicon, Inc. --~--~-~--~~~---~--~~ You received this message b

Re: creating a website log

2007-03-05 Thread limodou
I think signals will be easier, if you also want to record delete information of a record, you can also hook pre_delete, the pseudo code is: from django.db.models import signals def pre_save(sender, instance, signal, *args, **kwargs): if instance.id:#update state = 'change'

Re: creating a website log

2007-03-05 Thread Rubic
My solution is this: I've ripped out some stuff from the old admin code and written AppLogModel with three methods: def add(self, request): def remove(self, request): def update(self, request): The add/update methods call save() and remove calls delete(). Each method invokes a log

Re: creating a website log

2007-03-05 Thread limodou
I think maybe you can hook the pre_save() signal to do this thing. -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: creating a website log

2007-03-05 Thread Patrick
On Mon, 05 Mar 2007 12:33:09 +0100, Aidas Bendoraitis wrote: > Maybe this could help you: > http://www.djangosnippets.org/snippets/16/ > > Regards, > Aidas Bendoraitis [aka Archatas] > > On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote: >> >> Hi, I'd like to create a website log, similar to the log

Re: creating a website log

2007-03-05 Thread Kai Kuehne
Hi, * Patrick <[EMAIL PROTECTED]> wrote: > Is there a way to take the logging features in admin app and customise > them for my site, or is it coupled too tightly with the admin section to > even take that route? I think there's a full-history branch in the svn. But I don't know if it's actively

Re: creating a website log

2007-03-05 Thread Aidas Bendoraitis
Maybe this could help you: http://www.djangosnippets.org/snippets/16/ Regards, Aidas Bendoraitis [aka Archatas] On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote: > > Hi, I'd like to create a website log, similar to the log found in > django.contrib.admin and was wondering if anyone has thought about

creating a website log

2007-03-03 Thread Patrick
Hi, I'd like to create a website log, similar to the log found in django.contrib.admin and was wondering if anyone has thought about this before. Is there a way to take the logging features in admin app and customise them for my site, or is it coupled too tightly with the admin section to eve