>But if I implement it in the extra_filters.py wont it put the image I
>add into every badge? How do I just put an image into one badge. And
>no I am not going to be stealing
woot.com logo and using it. That was
>just an example because
www.stackoverflow.com has the woot badge and I
>want to know how they added an image.
One way to do it is via storing your special html code in a
dictionary...
I am pretty rusty in python.
http://docs.python.org/tutorial/datastructures.html#dictionaries
You could check the Badge.name with an if statement and replace it or
not.
Multiple if statements can work as well, as long as it's not too long,
then you should better go with using the dictionary.
But then again, there can't be too many badges, this could be faster.
Another way could be modifying badge to carry optional html code and
maybe a boolean portion indicating whether it has the image or not.
(I wouldn't go that far because it's too much work for no performance
gain.)
>Can you also explain why when I click on a badge that has been
>awarded, it gives an error 500 page instead of displaying who was
>awarded the badge. Visit
http://askagamer.com/account/signin/ to see
>what I am talking about. Many thanks to this wonderful and helpful
>community.
I thought I mentioned I don't know much about the badges. :| After
doing some brief investigation, it seems like you need to use sql
queries to add badge types.
I realize that the code base I am using is probably too old.
I suggest you search already working badges (with their badge id) and
do your investigation. It probably boil down to adding some badges
into the sql queries.
I would begin with searching for "Adventurous", or "adventurous".
Btw, the way you could investigate would be looking at the link (is it
broken?), then looking at urls.py (read some docs about urls.py +
Internationalization)
then looking at the appropriate method... etc. Trust me, reading that
manual, will help.
Hope this helps. Remember. If something seems wrong, take a look at
the html code with Firebug -> urls.py -> ... debugging method.
(Also, turning the debugger on helps too, on your development
platform.)
Go to settings.py remove comments on the following and make sure debug
is on for development platform, pretty useful for doing stack tracing.
(shows sql queries as well)
#'debug_toolbar.middleware.DebugToolbarMiddleware',
cheers,