]> git.parisson.com Git - mezzo.git/commitdiff
Add project topics
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 16 Sep 2016 16:38:20 +0000 (18:38 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 16 Sep 2016 16:38:20 +0000 (18:38 +0200)
app/organization/projects/migrations/0008_auto_20160916_1835.py [new file with mode: 0644]
app/organization/projects/models.py

diff --git a/app/organization/projects/migrations/0008_auto_20160916_1835.py b/app/organization/projects/migrations/0008_auto_20160916_1835.py
new file mode 100644 (file)
index 0000000..20c285f
--- /dev/null
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-16 16:35
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-projects', '0007_auto_20160907_1718'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='ProjectSubTopic',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+            ],
+            options={
+                'verbose_name': 'project sub topic',
+            },
+        ),
+        migrations.CreateModel(
+            name='ProjectTopic',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+            ],
+            options={
+                'verbose_name': 'project topic',
+            },
+        ),
+        migrations.AddField(
+            model_name='project',
+            name='sub_topic',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='organization-projects.ProjectSubTopic', verbose_name='sub topic'),
+        ),
+        migrations.AddField(
+            model_name='project',
+            name='topic',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='organization-projects.ProjectTopic', verbose_name='topic'),
+        ),
+    ]
index 6d9e8d17b46b3cbb27b779aa9612ad8d8de9643c..49bfbfeb9ba72a68d5dab7a17254c01f6e0f10ba 100644 (file)
@@ -24,6 +24,8 @@ class Project(Displayable, Period, RichText):
     teams = models.ManyToManyField('organization-network.Team', verbose_name=_('teams'), related_name='partner_projects', blank=True)
     organizations = models.ManyToManyField('organization-network.Organization', verbose_name=_('organizations'), blank=True)
     website = models.URLField(_('website'), max_length=512, blank=True)
+    topic = models.ForeignKey('ProjectTopic', verbose_name=_('topic'), related_name='projects', blank=True, null=True)
+    sub_topic = models.ForeignKey('ProjectSubTopic', verbose_name=_('sub topic'), related_name='projects', blank=True, null=True)
 
     class Meta:
         verbose_name = _('project')
@@ -35,6 +37,18 @@ class Project(Displayable, Period, RichText):
         return reverse("organization-project-detail", kwargs={"slug": self.slug})
 
 
+class ProjectTopic(Named):
+
+    class Meta:
+        verbose_name = _('project topic')
+
+
+class ProjectSubTopic(Named):
+
+    class Meta:
+        verbose_name = _('project sub topic')
+
+
 class ProjectProgram(Named):
 
     class Meta: