]> git.parisson.com Git - mezzo.git/commitdiff
Task #135 : cleaning Brief field
authorEmilie <zawadzki@ircam.fr>
Thu, 25 Aug 2016 16:43:56 +0000 (18:43 +0200)
committerEmilie <zawadzki@ircam.fr>
Thu, 25 Aug 2016 16:43:56 +0000 (18:43 +0200)
app/organization/magazine/admin.py
app/organization/magazine/migrations/0008_auto_20160825_1835.py [new file with mode: 0644]
app/organization/magazine/migrations/0009_auto_20160825_1838.py [new file with mode: 0644]
app/organization/magazine/migrations/0010_auto_20160825_1843.py [new file with mode: 0644]
app/organization/magazine/models.py
app/organization/magazine/translation.py

index 553b249a39af7a185592573c5b8f1f6cc046e0e2..739122558e2d439f07a131e6e2119cd4e0d53245 100644 (file)
@@ -36,7 +36,7 @@ class BriefAdminDisplayable(BaseTranslationModelAdmin,): #, OrderableAdmin
     list_display = ('title', 'external_content', 'content_object', )
     form = BriefForm
     fieldsets = deepcopy(BriefAdmin.fieldsets)
-
+    exclude = ("short_url", "keywords", "description", "slug", )
 
 
 admin.site.register(Article, ArticleAdminDisplayable)
diff --git a/app/organization/magazine/migrations/0008_auto_20160825_1835.py b/app/organization/magazine/migrations/0008_auto_20160825_1835.py
new file mode 100644 (file)
index 0000000..9137734
--- /dev/null
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-08-25 16:35
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-magazine', '0007_auto_20160825_1614'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='brief',
+            name='external_content_en',
+        ),
+        migrations.RemoveField(
+            model_name='brief',
+            name='external_content_fr',
+        ),
+    ]
diff --git a/app/organization/magazine/migrations/0009_auto_20160825_1838.py b/app/organization/magazine/migrations/0009_auto_20160825_1838.py
new file mode 100644 (file)
index 0000000..a8688d2
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-08-25 16:38
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-magazine', '0008_auto_20160825_1835'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='brief',
+            name='content_type',
+            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='local content'),
+        ),
+    ]
diff --git a/app/organization/magazine/migrations/0010_auto_20160825_1843.py b/app/organization/magazine/migrations/0010_auto_20160825_1843.py
new file mode 100644 (file)
index 0000000..a72869b
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-08-25 16:43
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-magazine', '0009_auto_20160825_1838'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='article',
+            name='department',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='organization-network.Department', verbose_name='department'),
+        ),
+    ]
index 5f9b234bc5a77474a21da3b68548f387f69bcf24..a926c66cba53908947358951f806a3eeb4d059fa 100644 (file)
@@ -18,7 +18,7 @@ class Article(BlogPost, SubTitled):
 
     related_articles = models.ManyToManyField("self",
                                  verbose_name=_("Related articles"), blank=True)
-    department = models.ForeignKey(Department, related_name='articles', limit_choices_to=dict(id__in=Department.objects.all()), blank=True, null=True, on_delete=models.SET_NULL)
+    department = models.ForeignKey(Department, verbose_name=_('department'), related_name='articles', limit_choices_to=dict(id__in=Department.objects.all()), blank=True, null=True, on_delete=models.SET_NULL)
     topics = models.ManyToManyField("Topic", verbose_name=_('topics'), related_name="articles", blank=True, null=True)
 
     def get_absolute_url(self):
@@ -40,13 +40,13 @@ class ArticleImage(Image):
 
 class Brief(Displayable, RichText): #Orderable
 
-    text_button = models.CharField(blank=True, max_length=150, null=False, verbose_name='text button')
-    external_content = models.URLField(blank=True, max_length=1000, null=False, verbose_name='external content')
+    text_button = models.CharField(blank=True, max_length=150, null=False, verbose_name=_('text button'))
+    external_content = models.URLField(blank=True, max_length=1000, null=False, verbose_name=_('external content'))
 
     # used for autocomplete but hidden in admin
     content_type = models.ForeignKey(
         ContentType,
-        verbose_name=_('content page'),
+        verbose_name=_('local content'),
         null=True,
         blank=True,
         editable=False,
index 063dc59e0dfe8fa6c5fae11f3d8b979cce51450d..3c53e1d17a9b81fa7aee2f8655e8ba4d73e07d6e 100644 (file)
@@ -15,7 +15,7 @@ class ArticleTranslationOptions(TranslationOptions):
 @register(Brief)
 class BriefTranslationOptions(TranslationOptions):
 
-    fields = ('text_button', 'external_content', )
+    fields = ('text_button', )
 
 @register(Topic)
 class TopicTranslationOptions(TranslationOptions):