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