1 from django.db import models
2 from django.utils.translation import ugettext_lazy as _
5 class ButtonGroup(models.Model):
6 name = models.CharField(max_length=32)
7 slug = models.SlugField()
8 position = models.IntegerField(default=0)
11 ordering = ('position', 'name',)
12 verbose_name, verbose_name_plural = _('button group'), _('button groups')
14 def __unicode__(self):
18 class Button(models.Model):
19 label = models.CharField(max_length=32)
20 slug = models.SlugField()
21 tag = models.CharField(max_length=128)
22 key = models.IntegerField(blank=True, null=True)
23 position = models.IntegerField(default=0)
25 group = models.ManyToManyField(ButtonGroup)
28 ordering = ('position', 'label',)
29 verbose_name, verbose_name_plural = _('button'), _('buttons')
31 def __unicode__(self):