Friday, May 25, 2012

Django Badges app

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/707Fc1maKcAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment