diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-11-17 12:36:22 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-11-17 12:36:22 +0100 |
commit | 4480edffabb942df4fcc6a91cb58e71a40c978a8 (patch) | |
tree | 02b17aac706511f9c9cfe6072d519a8f7eaba619 /ishtar_common/models.py | |
parent | 2e4847a414f44600dc25fd1152c1bcff173f76de (diff) | |
download | Ishtar-4480edffabb942df4fcc6a91cb58e71a40c978a8.tar.bz2 Ishtar-4480edffabb942df4fcc6a91cb58e71a40c978a8.zip |
Custom forms: model
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 08276fa9f..1562280ef 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1631,6 +1631,23 @@ post_save.connect(cached_site_changed, sender=IshtarSiteProfile) post_delete.connect(cached_site_changed, sender=IshtarSiteProfile) +class CustomForm(models.Model): + name = models.CharField(_(u"Name"), max_length=250) + form = models.CharField(_(u"Form"), max_length=250) + available = models.BooleanField(_(u"Available"), default=True) + apply_to_all = models.BooleanField( + _(u"Apply to all"), default=False, + help_text=_(u"Apply this form to all users. If set to True, selecting " + u"user and user type is useless.")) + users = models.ManyToManyField('IshtarUser', blank=True) + user_types = models.ManyToManyField('PersonType', blank=True) + + class Meta: + verbose_name = _(u"Custom form") + verbose_name_plural = _(u"Custom forms") + ordering = ['name', 'form'] + + class GlobalVar(models.Model, Cached): slug = models.SlugField(_(u"Variable name"), unique=True) description = models.TextField(_(u"Description of the variable"), |