X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d8006182f05f235f38fd7ca1c74a808ffac71a31..9bbfcaec3e58c99635b5abe7484e44b41e60d5fc:/apps/toolbar/models.py?ds=sidebyside diff --git a/apps/toolbar/models.py b/apps/toolbar/models.py new file mode 100644 index 00000000..ad4752af --- /dev/null +++ b/apps/toolbar/models.py @@ -0,0 +1,32 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ + + +class ButtonGroup(models.Model): + name = models.CharField(max_length=32) + slug = models.SlugField() + position = models.IntegerField(default=0) + + class Meta: + ordering = ['name'] + verbose_name, verbose_name_plural = _('button group'), _('button groups') + + def __unicode__(self): + return self.name + + +class Button(models.Model): + label = models.CharField(max_length=32) + slug = models.SlugField() + tag = models.CharField(max_length=128) + key = models.IntegerField(blank=True, null=True) + position = models.IntegerField(default=0) + + group = models.ManyToManyField(ButtonGroup) + + class Meta: + ordering = ['label'] + verbose_name, verbose_name_plural = _('button'), _('buttons') + + def __unicode__(self): + return self.label