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
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
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
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'
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
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
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
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
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
9 matches
Mail list logo