summaryrefslogtreecommitdiffstats
path: root/welco/qualif/models.py
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2015-07-08 19:36:05 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2015-09-29 16:12:40 (GMT)
commit737ffffd7fb21bbba8c5efb2e5132329d38bf8ec (patch)
tree755f8481a727c3e026cb7150daeabf2d2cc333a3 /welco/qualif/models.py
parent9e42a5d069bbe64d9eea8a14fab5691eed97ce4f (diff)
downloadwelco-737ffffd7fb21bbba8c5efb2e5132329d38bf8ec.zip
welco-737ffffd7fb21bbba8c5efb2e5132329d38bf8ec.tar.gz
welco-737ffffd7fb21bbba8c5efb2e5132329d38bf8ec.tar.bz2
general: make it possible to associate formdefs to a mail
Diffstat (limited to 'welco/qualif/models.py')
-rw-r--r--welco/qualif/models.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/welco/qualif/models.py b/welco/qualif/models.py
new file mode 100644
index 0000000..addfed2
--- /dev/null
+++ b/welco/qualif/models.py
@@ -0,0 +1,39 @@
+# welco - multichannel request processing
+# Copyright (C) 2015 Entr'ouvert
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.contrib.contenttypes.models import ContentType
+from django.contrib.contenttypes import generic
+from django.db import models
+
+
+class FormdefReference(models.Model):
+ reference = models.CharField(max_length=250)
+
+
+class FormdataReference(models.Model):
+ reference = models.CharField(max_length=250)
+
+
+class Association(models.Model):
+ source_type = models.ForeignKey(ContentType)
+ source_pk = models.PositiveIntegerField()
+ source = generic.GenericForeignKey('source_type', 'source_pk')
+
+ formdefs = models.ManyToManyField(FormdefReference)
+ formdatas = models.ManyToManyField(FormdataReference)
+
+ # +avis a (roles or users?)
+ # +info a (roles or users?)