At what point are user activities recorded to the database?

3 views
Skip to first unread message

Daxon

unread,
Jan 12, 2010, 1:34:19 PM1/12/10
to CNProg open discussion
I don't know python/django, but I'm doing a pretty good job reverse
engineering it to Java

I just can't find at what point, in what file, are the users activity
of say "asking a question"
is recorded into the activity table?

I would think it would be right by when saving a new question, or any
other activity

If you could give me a file, line number, and briefly explain whats
going on,

Chagel

unread,
Jan 12, 2010, 9:14:23 PM1/12/10
to CNProg open discussion
Activities are recorded by using Django signals tech - callback saving
after changes on question or answer models.
You can find them in the end of models.py.

-Mike

Daxon

unread,
Jan 13, 2010, 9:16:33 AM1/13/10
to CNProg open discussion
Thanks, Just read up on signals,
Finding Django to be a great framework,
I'll give it a tryout

What I read from
http://www.mercurytide.co.uk/news/article/django-signals/

says to call a signal..

dispatcher.connect(send_entry_created_email, signal=signals.post_save,
sender=Entry)

yet in CNProg
it seems to call the signal in a shortcut,

Is this a shortcut to call say "Award, on post_save call
'record_award_event' " ?

post_save.connect(record_award_event, sender=Award)
post_save.connect(notify_award_message, sender=Award)
post_save.connect(record_answer_accepted, sender=Answer)

Reply all
Reply to author
Forward
0 new messages