Re: How to get hold of a session after getting signaled?

2015-01-31 Thread Babatunde Akinyanmi
On 31 Jan 2015 10:11, "Stephen J. Butler" wrote: > > You still could store the do_something_after_badge_awarded result in a > database table, but cache the lookups from the view for something > short, like 5 minutes. How quickly after a badge is awarded do people > need

Re: How to get hold of a session after getting signaled?

2015-01-31 Thread Stephen J. Butler
You still could store the do_something_after_badge_awarded result in a database table, but cache the lookups from the view for something short, like 5 minutes. How quickly after a badge is awarded do people need to be notified? Also, you could use a memcached library to store/fetch the awards by

Re: How to get hold of a session after getting signaled?

2015-01-31 Thread Tobias Dacoir
I can't just call badge.award_to(user) because I need to wait for the check logic to verify if the user should receive a badge or not. My workaround is that I created a new table that inserts badge and user foreign keys and before the view is rendered I will check this table for any entries

Re: How to get hold of a session after getting signaled?

2015-01-30 Thread Vijay Khemlani
As far as I can tell on the project source, the only place the "badge_awarded" signal is triggered is in the "award_to" method in the Badge class, which does not handle a request object. If you are calling something like "badge.award_to(user)" in one of your views, then you can modify the request

How to get hold of a session after getting signaled?

2015-01-30 Thread Tobias Dacoir
I'm using django-badges in my project which can emit a signal when a user is awarded a badge. I was able to implemented a receiver function, however the output is the following: signals.py (from badges): import django.dispatch badge_awarded = django.dispatch.Signal(providing_args=['user',