Django Badges app

62 views
Skip to first unread message

Pratik Mandrekar

unread,
May 25, 2012, 8:23:59 AM5/25/12
to django...@googlegroups.com
Hi,


I have been looking at the Badges app in django - https://github.com/eldarion/brabeion/blob/master/docs/usage.txt and while it seems to be good at tracking the user's badges It doesn't have an easy way to associate images with badges. 

I tried inheriting the BadgeDetails class and using it as levels to the extended Badge class but I still am confused as to how to use it properly in an app. 

class BadgeIcon(models.Model):

    name = models.CharField(max_length=100)
    description = models.TextField()
    image = models.ImageField(upload_to="badges/", blank=True)

class ExtraBadgeDetails(BadgeDetail):
    def __init__(self, badgeIcon):
self.name= badgeIcon.name
self.description = badgeIcon.description
self.image = badgeIcon.image 

class PointsBadge(Badge):

    def __init__(self, levels = None):
self.levels = levels

One registers the badges at the class level as badges.register(PointsBadge) and I don't really see any way to do it with object instances or how to create badges with icons whenever I want to in my app.

Anyone used this app before and customized it for their app? Or any other suggestions for similar functionality?


Thanks,

Pratik

Murph Murphy

unread,
Jun 1, 2012, 1:44:13 PM6/1/12
to django...@googlegroups.com
I've been trying to use brabeion as well, but I can't even get it to work without giving me a KeyError and the event that fired. Not really sure how to fix it, the error crops up in line 29 of internals.py

As far as adding icons to it, though I think the concept of brabeion overall is superior, you may want to take a look at this project as they seem to support icons by default. 

I really think brabeion is great, just wish someone/someone from eldarion would go through and update it and add some more documentation.

Murph
Reply all
Reply to author
Forward
0 new messages