summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-17 17:50:44 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-17 17:50:44 +0100
commit986725aacb88131471ffe61a3a2e32c57408a05b (patch)
tree7cd4be16f875a502231efa949b77d2e7db12d8c0
parent373a9d9531f2cb7ef954f7af14baaea33b74bdff (diff)
downloadIshtar-986725aacb88131471ffe61a3a2e32c57408a05b.tar.bz2
Ishtar-986725aacb88131471ffe61a3a2e32c57408a05b.zip
Custom forms: exclude field model
-rw-r--r--ishtar_common/migrations/0023_excludedfield.py28
-rw-r--r--ishtar_common/models.py9
2 files changed, 37 insertions, 0 deletions
diff --git a/ishtar_common/migrations/0023_excludedfield.py b/ishtar_common/migrations/0023_excludedfield.py
new file mode 100644
index 000000000..2573219ae
--- /dev/null
+++ b/ishtar_common/migrations/0023_excludedfield.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11 on 2017-11-17 17:37
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0022_customform'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='ExcludedField',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('field', models.CharField(max_length=250, verbose_name='Field')),
+ ('custom_form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='excluded_fields', to='ishtar_common.CustomForm')),
+ ],
+ options={
+ 'verbose_name': 'Custom form - excluded field',
+ 'verbose_name_plural': 'Custom form - excluded fields',
+ },
+ ),
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 1562280ef..a5a3d96c1 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1648,6 +1648,15 @@ class CustomForm(models.Model):
ordering = ['name', 'form']
+class ExcludedField(models.Model):
+ custom_form = models.ForeignKey(CustomForm, related_name='excluded_fields')
+ field = models.CharField(_(u"Field"), max_length=250)
+
+ class Meta:
+ verbose_name = _(u"Custom form - excluded field")
+ verbose_name_plural = _(u"Custom form - excluded fields")
+
+
class GlobalVar(models.Model, Cached):
slug = models.SlugField(_(u"Variable name"), unique=True)
description = models.TextField(_(u"Description of the variable"),