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() #unused
22 action = models.CharField(max_length=256)
24 key = models.CharField(blank=True, max_length=1)
25 position = models.IntegerField(default=0)
27 group = models.ManyToManyField(ButtonGroup)
30 ordering = ('position', 'label',)
31 verbose_name, verbose_name_plural = _('button'), _('buttons')
33 def __unicode__(self):