from django.db import models
from filebrowser.fields import FileBrowseField
from django.utils.translation import ugettext_lazy as _


class Category(models.Model):
    name = models.CharField(_("Name"), max_length=255)
    parent_category = models.ForeignKey('self', blank=True, null=True, related_name="child_categories")

class Achievement(models.Model):
    name = models.CharField(_("Name"), max_length=255)
    description = models.TextField(_("Description"))
    points = models.IntegerField(blank=False, default=0)
    icon = FileBrowseField(_("Icon"), directory='icons/', format='image', max_length=255, blank=False)
    category = models.ForeignKey(Category)
@@ -22,16 +22,60 @@
  models%0A
+from django.contrib.auth.models import User%0A
 from fil
@@ -704,8 +704,115 @@
 ategory)
+%0A%0Aclass UserAchievement(Achievement):%0A    users = models.ManyToManyField(User, related_name=%22achievements%22)

add class UserAchievement add User