]> git.parisson.com Git - mezzo.git/commitdiff
use Displayable for most of models, add agenda migrations, use runserver for now..
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Feb 2016 12:40:01 +0000 (13:40 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Feb 2016 12:40:01 +0000 (13:40 +0100)
17 files changed:
app/deploy/start_app.sh
app/festival/admin.py
app/festival/migrations/0001_initial.py
app/festival/migrations/0002_auto_20160224_1243.py [new file with mode: 0644]
app/festival/migrations/0003_auto_20160224_1835.py [new file with mode: 0644]
app/festival/migrations/0004_auto_20160225_0352.py [new file with mode: 0644]
app/festival/migrations/0005_auto_20160225_0500.py [new file with mode: 0644]
app/festival/migrations/0006_auto_20160225_0503.py [new file with mode: 0644]
app/festival/migrations/0007_auto_20160225_1214.py [new file with mode: 0644]
app/festival/migrations/0008_auto_20160225_1218.py [new file with mode: 0644]
app/festival/models.py
app/migrations/mezzanine_agenda/0001_initial.py [new file with mode: 0644]
app/migrations/mezzanine_agenda/0002_auto_20160224_1142.py [new file with mode: 0644]
app/migrations/mezzanine_agenda/__init__.py [new file with mode: 0644]
app/sandbox/local_settings.py
app/translations.py
docker-compose.yml

index b4a8b98f5fb8c91408e3e05e3105f0fdf373c203..e94244d64deab45dff88fcd5b6a9f1cf3849dbdf 100644 (file)
@@ -39,9 +39,9 @@ watchmedo shell-command --patterns="*.js;*.css" --recursive \
     --command='python '$manage' collectstatic --noinput' $src &
 
 # app start
-if [ $1 == "--runserver" ]
+if [ $1 = "--runserver" ]
 then
-    python $manage runserver_plus 0.0.0.0:8000
+    python $manage runserver 0.0.0.0:9000
 else
     uwsgi --socket :$port --wsgi-file $wsgi --chdir $app --master \
     --processes $processes --threads $threads \
index 0effca5a194a3080f9284488fda23d6c975ac19e..1438053e59400e290039fc97f49e1864fa825353 100644 (file)
@@ -1,6 +1,64 @@
+from __future__ import unicode_literals
+
+from copy import deepcopy
+
 from django.contrib import admin
+from django.utils.translation import ugettext_lazy as _
+
+from mezzanine_agenda.models import Event, EventLocation
+from mezzanine_agenda.admin import *
+
+from mezzanine.conf import settings
+from mezzanine.core.admin import DisplayableAdmin, OwnableAdmin
+
 from festival.models import *
 
-admin.site.register(MetaEvent)
-admin.site.register(Artist)
-admin.site.register(Video)
+
+class FestivalEventInline(admin.StackedInline):
+    model = FestivalEvent
+    extra = 1
+
+
+class FestivalEventAdmin(EventAdmin):
+    """
+    Admin class for events.
+    """
+
+    inlines = [FestivalEventInline, ]
+
+
+class ArtistAdmin(admin.ModelAdmin):
+
+    model = Artist
+
+
+class VideoAdmin(admin.ModelAdmin):
+
+    model = Video
+
+
+class VideoAdminDisplayable(DisplayableAdmin):
+
+    fieldsets = deepcopy(VideoAdmin.fieldsets)
+
+
+class ArtistAdminDisplayable(DisplayableAdmin):
+    """
+    Admin class for artists.
+    """
+
+    fieldsets = deepcopy(ArtistAdmin.fieldsets)
+
+
+    def save_form(self, request, form, change):
+        """
+        Super class ordering is important here - user must get saved first.
+        """
+        return DisplayableAdmin.save_form(self, request, form, change)
+
+
+admin.site.unregister(Event)
+admin.site.register(Event, FestivalEventAdmin)
+
+admin.site.register(Artist, ArtistAdminDisplayable)
+admin.site.register(Video, VideoAdminDisplayable)
index 94e63fb56841d5e1acaa8e2cc328bb88fe897185..3967870c987f27f494241cd000c2b9f76c7156ae 100644 (file)
@@ -9,8 +9,8 @@ import mezzanine.core.fields
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('mezzanine_agenda', '0001_initial'),
         ('sites', '0001_initial'),
+        ('mezzanine_agenda', '0002_auto_20160224_1142'),
     ]
 
     operations = [
@@ -19,9 +19,11 @@ class Migration(migrations.Migration):
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('name', models.CharField(max_length=255, verbose_name='name')),
-                ('photo', models.ImageField(upload_to=b'images/%Y/%m/%d', max_length=1024, verbose_name='photo')),
+                ('photo', mezzanine.core.fields.FileField(max_length=1024, verbose_name='photo', blank=True)),
                 ('photo_credits', models.CharField(max_length=255, null=True, verbose_name='photo credits', blank=True)),
                 ('bio', mezzanine.core.fields.RichTextField(null=True, verbose_name='bio', blank=True)),
+                ('bio_fr', mezzanine.core.fields.RichTextField(null=True, verbose_name='bio', blank=True)),
+                ('bio_en', mezzanine.core.fields.RichTextField(null=True, verbose_name='bio', blank=True)),
             ],
             options={
                 'db_table': 'festival_artists',
@@ -35,6 +37,7 @@ class Migration(migrations.Migration):
                 ('eve_event_id', models.IntegerField(verbose_name='eve id', blank=True)),
                 ('featured', models.BooleanField(verbose_name='featured')),
                 ('featured_image', mezzanine.core.fields.FileField(max_length=1024, verbose_name='featured image', blank=True)),
+                ('featured_image_header', mezzanine.core.fields.FileField(max_length=1024, verbose_name='featured image header', blank=True)),
                 ('artists', models.ManyToManyField(related_name='metaevents', verbose_name='artists', to='festival.Artist', blank=True)),
                 ('event', models.ForeignKey(related_name='meta_events', on_delete=django.db.models.deletion.SET_NULL, verbose_name='meta event', blank=True, to='mezzanine_agenda.Event', null=True)),
             ],
diff --git a/app/festival/migrations/0002_auto_20160224_1243.py b/app/festival/migrations/0002_auto_20160224_1243.py
new file mode 100644 (file)
index 0000000..92090c6
--- /dev/null
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('festival', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='artist',
+            name='bio',
+        ),
+        migrations.RemoveField(
+            model_name='artist',
+            name='bio_en',
+        ),
+        migrations.RemoveField(
+            model_name='artist',
+            name='bio_fr',
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='content',
+            field=mezzanine.core.fields.RichTextField(default='', verbose_name='Content'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='content_en',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='content_fr',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+        migrations.AlterField(
+            model_name='video',
+            name='event',
+            field=models.ForeignKey(related_name='videos', on_delete=django.db.models.deletion.SET_NULL, verbose_name='event', blank=True, to='mezzanine_agenda.Event', null=True),
+        ),
+    ]
diff --git a/app/festival/migrations/0003_auto_20160224_1835.py b/app/festival/migrations/0003_auto_20160224_1835.py
new file mode 100644 (file)
index 0000000..ca49b2d
--- /dev/null
@@ -0,0 +1,100 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('festival', '0002_auto_20160224_1243'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='EventCategory',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(verbose_name='description', blank=True)),
+            ],
+            options={
+                'verbose_name': 'event category',
+            },
+        ),
+        migrations.CreateModel(
+            name='PageCategory',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(verbose_name='description', blank=True)),
+            ],
+            options={
+                'verbose_name': 'page category',
+            },
+        ),
+        migrations.RemoveField(
+            model_name='artist',
+            name='content',
+        ),
+        migrations.RemoveField(
+            model_name='artist',
+            name='content_en',
+        ),
+        migrations.RemoveField(
+            model_name='artist',
+            name='content_fr',
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='bio',
+            field=mezzanine.core.fields.RichTextField(verbose_name='biography', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='bio_en',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='biography', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='bio_fr',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='biography', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='description',
+            field=models.TextField(verbose_name='description', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='description_en',
+            field=models.TextField(null=True, verbose_name='description', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='description_fr',
+            field=models.TextField(null=True, verbose_name='description', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='featured',
+            field=models.BooleanField(default=False, verbose_name='featured'),
+        ),
+        migrations.AlterField(
+            model_name='artist',
+            name='name',
+            field=models.CharField(max_length=512, verbose_name='name'),
+        ),
+        migrations.AlterField(
+            model_name='metaevent',
+            name='featured',
+            field=models.BooleanField(default=False, verbose_name='featured'),
+        ),
+        migrations.AddField(
+            model_name='metaevent',
+            name='category',
+            field=models.ForeignKey(related_name='meta_events', on_delete=django.db.models.deletion.SET_NULL, verbose_name='category', blank=True, to='festival.EventCategory', null=True),
+        ),
+    ]
diff --git a/app/festival/migrations/0004_auto_20160225_0352.py b/app/festival/migrations/0004_auto_20160225_0352.py
new file mode 100644 (file)
index 0000000..566c4cd
--- /dev/null
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('mezzanine_agenda', '0002_auto_20160224_1142'),
+        ('festival', '0003_auto_20160224_1835'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='FestivalEvent',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('eve_event_id', models.IntegerField(verbose_name='eve id', blank=True)),
+                ('featured', models.BooleanField(default=False, verbose_name='featured')),
+                ('featured_image', mezzanine.core.fields.FileField(max_length=1024, verbose_name='featured image', blank=True)),
+                ('featured_image_header', mezzanine.core.fields.FileField(max_length=1024, verbose_name='featured image header', blank=True)),
+                ('artists', models.ManyToManyField(related_name='metaevents', verbose_name='artists', to='festival.Artist', blank=True)),
+                ('category', models.ForeignKey(related_name='festival_events', on_delete=django.db.models.deletion.SET_NULL, verbose_name='category', blank=True, to='festival.EventCategory', null=True)),
+                ('event', models.ForeignKey(related_name='festival_events', on_delete=django.db.models.deletion.SET_NULL, verbose_name='festival event', blank=True, to='mezzanine_agenda.Event', null=True)),
+            ],
+            options={
+                'db_table': 'festival_events',
+                'verbose_name': 'festival event',
+            },
+        ),
+        migrations.RemoveField(
+            model_name='metaevent',
+            name='artists',
+        ),
+        migrations.RemoveField(
+            model_name='metaevent',
+            name='category',
+        ),
+        migrations.RemoveField(
+            model_name='metaevent',
+            name='event',
+        ),
+        migrations.DeleteModel(
+            name='MetaEvent',
+        ),
+    ]
diff --git a/app/festival/migrations/0005_auto_20160225_0500.py b/app/festival/migrations/0005_auto_20160225_0500.py
new file mode 100644 (file)
index 0000000..67f2050
--- /dev/null
@@ -0,0 +1,108 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('sites', '0001_initial'),
+        ('festival', '0004_auto_20160225_0352'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='artist',
+            name='name',
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='_meta_title',
+            field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='content',
+            field=mezzanine.core.fields.RichTextField(default='', verbose_name='Content'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='created',
+            field=models.DateTimeField(null=True, editable=False),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='expiry_date',
+            field=models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='gen_description',
+            field=models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description'),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='in_sitemap',
+            field=models.BooleanField(default=True, verbose_name='Show in sitemap'),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='keywords_string',
+            field=models.CharField(max_length=500, editable=False, blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='publish_date',
+            field=models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='short_url',
+            field=models.URLField(null=True, blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='site',
+            field=models.ForeignKey(default=None, editable=False, to='sites.Site'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='slug',
+            field=models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='status',
+            field=models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')]),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='title',
+            field=models.CharField(default='', max_length=500, verbose_name='Title'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='updated',
+            field=models.DateTimeField(null=True, editable=False),
+        ),
+        migrations.AlterField(
+            model_name='artist',
+            name='description',
+            field=models.TextField(verbose_name='Description', blank=True),
+        ),
+        migrations.AlterField(
+            model_name='artist',
+            name='description_en',
+            field=models.TextField(null=True, verbose_name='Description', blank=True),
+        ),
+        migrations.AlterField(
+            model_name='artist',
+            name='description_fr',
+            field=models.TextField(null=True, verbose_name='Description', blank=True),
+        ),
+    ]
diff --git a/app/festival/migrations/0006_auto_20160225_0503.py b/app/festival/migrations/0006_auto_20160225_0503.py
new file mode 100644 (file)
index 0000000..03e6316
--- /dev/null
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('festival', '0005_auto_20160225_0500'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='artist',
+            name='content_en',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='content_fr',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='title_en',
+            field=models.CharField(max_length=500, null=True, verbose_name='Title'),
+        ),
+        migrations.AddField(
+            model_name='artist',
+            name='title_fr',
+            field=models.CharField(max_length=500, null=True, verbose_name='Title'),
+        ),
+    ]
diff --git a/app/festival/migrations/0007_auto_20160225_1214.py b/app/festival/migrations/0007_auto_20160225_1214.py
new file mode 100644 (file)
index 0000000..0b03017
--- /dev/null
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('festival', '0006_auto_20160225_0503'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='video',
+            name='content',
+            field=mezzanine.core.fields.RichTextField(default='', verbose_name='Content'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='video',
+            name='description_en',
+            field=models.TextField(null=True, verbose_name='Description', blank=True),
+        ),
+        migrations.AddField(
+            model_name='video',
+            name='description_fr',
+            field=models.TextField(null=True, verbose_name='Description', blank=True),
+        ),
+        migrations.AddField(
+            model_name='video',
+            name='title_en',
+            field=models.CharField(max_length=500, null=True, verbose_name='Title'),
+        ),
+        migrations.AddField(
+            model_name='video',
+            name='title_fr',
+            field=models.CharField(max_length=500, null=True, verbose_name='Title'),
+        ),
+    ]
diff --git a/app/festival/migrations/0008_auto_20160225_1218.py b/app/festival/migrations/0008_auto_20160225_1218.py
new file mode 100644 (file)
index 0000000..5e514a1
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('festival', '0007_auto_20160225_1214'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='video',
+            name='content_en',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+        migrations.AddField(
+            model_name='video',
+            name='content_fr',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+    ]
index 092a3c71c5381901d18188991516df63c408d7a3..0324bc23bb4bf09d3951e1eb3ec275b08409e71d 100644 (file)
@@ -3,6 +3,7 @@ from django.utils.translation import ugettext_lazy as _
 
 from mezzanine.core.models import RichText, Displayable
 from mezzanine.core.fields import RichTextField, OrderField, FileField
+from mezzanine.utils.models import AdminThumbMixin, upload_to
 
 from mezzanine_agenda.models import Event
 
@@ -18,31 +19,58 @@ class MetaCore:
     app_label = 'festival'
 
 
-class MetaEvent(models.Model):
+class BaseNameModel(models.Model):
+    """Base object with name and description"""
+
+    name = models.CharField(_('name'), max_length=512)
+    description = models.TextField(_('description'), blank=True)
+
+    class Meta(MetaCore):
+        abstract = True
+
+    def __unicode__(self):
+        return self.name
+
+class BaseTitleModel(models.Model):
+    """Base object with title and description"""
+
+    title = models.CharField(_('title'), max_length=512)
+    description = models.TextField(_('description'), blank=True)
+
+    class Meta(MetaCore):
+        abstract = True
+
+    def __unicode__(self):
+        return self.title
+
+
+class FestivalEvent(models.Model):
     """Extensible event metadata"""
 
-    event = models.ForeignKey(Event, related_name='meta_events', verbose_name=_('meta event'), blank=True, null=True, on_delete=models.SET_NULL)
+    event = models.ForeignKey(Event, related_name='festival_events', verbose_name=_('festival event'), blank=True, null=True, on_delete=models.SET_NULL)
     #eve_event = SpanningForeignKey(eve.models.EventVersion, related_name='festival_events', verbose_name=_('E-venement event'), blank=True, null=True, default=None)
     eve_event_id = models.IntegerField(_('eve id'), blank=True)
+    category = models.ForeignKey('EventCategory', related_name='festival_events', verbose_name=_('category'), blank=True, null=True, on_delete=models.SET_NULL)
     artists = models.ManyToManyField('Artist', related_name='metaevents', verbose_name=_('artists'), blank=True)
-    featured = models.BooleanField(_('featured'))
+    featured = models.BooleanField(_('featured'), default=False)
     featured_image = FileField(_('featured image'), upload_to='images/%Y/%m/%d', max_length=1024, blank=True, format="Image")
+    featured_image_header = FileField(_('featured image header'), upload_to='images/%Y/%m/%d', max_length=1024, blank=True, format="Image")
 
     class Meta(MetaCore):
-        verbose_name = _('meta event')
-        db_table = app_label + '_meta_events'
+        verbose_name = _('festival event')
+        db_table = app_label + '_events'
 
     def __unicode__(self):
         return self.event.title
 
 
-class Artist(models.Model):
+class Artist(Displayable, RichText, AdminThumbMixin):
     """Artist"""
 
-    name = models.CharField(_('name'), max_length=255)
-    photo = models.ImageField(_('photo'), upload_to='images/%Y/%m/%d', max_length=1024)
+    bio = RichTextField(_('biography'), blank=True)
+    photo = FileField(_('photo'), upload_to='images/%Y/%m/%d', max_length=1024, blank=True, format="Image")
     photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
-    bio = RichTextField(_("bio"), blank=True, null=True)
+    featured = models.BooleanField(_('featured'), default=False)
 
     search_fields = ("name", "bio")
 
@@ -54,11 +82,29 @@ class Artist(models.Model):
         db_table = app_label + '_artists'
 
 
-class Video(Displayable):
+class Video(Displayable, RichText):
     """Video"""
 
-    event = models.ForeignKey(Event, related_name='videos', verbose_name=_('meta event'), blank=True, null=True, on_delete=models.SET_NULL)
+    event = models.ForeignKey(Event, related_name='videos', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
     media_id = models.IntegerField(_('media id'))
 
     def __unicode__(self):
-        return u"Video"
+        return
+
+
+class EventCategory(BaseNameModel):
+    """Event Category"""
+
+    class Meta(MetaCore):
+        verbose_name = _('event category')
+
+
+class PageCategory(BaseNameModel):
+    """Page Category"""
+
+    class Meta(MetaCore):
+        verbose_name = _('page category')
+
+
+
+#class Article ?
diff --git a/app/migrations/mezzanine_agenda/0001_initial.py b/app/migrations/mezzanine_agenda/0001_initial.py
new file mode 100644 (file)
index 0000000..063a464
--- /dev/null
@@ -0,0 +1,88 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+import mezzanine.utils.models
+from django.conf import settings
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('sites', '0001_initial'),
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Event',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('comments_count', models.IntegerField(default=0, editable=False)),
+                ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)),
+                ('rating_count', models.IntegerField(default=0, editable=False)),
+                ('rating_sum', models.IntegerField(default=0, editable=False)),
+                ('rating_average', models.FloatField(default=0, editable=False)),
+                ('title', models.CharField(max_length=500, verbose_name='Title')),
+                ('title_fr', models.CharField(max_length=500, null=True, verbose_name='Title')),
+                ('title_en', models.CharField(max_length=500, null=True, verbose_name='Title')),
+                ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)),
+                ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)),
+                ('description', models.TextField(verbose_name='Description', blank=True)),
+                ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
+                ('created', models.DateTimeField(null=True, editable=False)),
+                ('updated', models.DateTimeField(null=True, editable=False)),
+                ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])),
+                ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True)),
+                ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)),
+                ('short_url', models.URLField(null=True, blank=True)),
+                ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
+                ('start', models.DateTimeField(verbose_name='Start')),
+                ('end', models.DateTimeField(null=True, verbose_name='End', blank=True)),
+                ('facebook_event', models.BigIntegerField(null=True, verbose_name='Facebook', blank=True)),
+                ('allow_comments', models.BooleanField(default=True, verbose_name='Allow comments')),
+                ('featured_image', mezzanine.core.fields.FileField(max_length=255, null=True, verbose_name='Featured Image', blank=True)),
+            ],
+            options={
+                'ordering': ('-start',),
+                'verbose_name': 'Event',
+                'verbose_name_plural': 'Events',
+            },
+            bases=(models.Model, mezzanine.utils.models.AdminThumbMixin),
+        ),
+        migrations.CreateModel(
+            name='EventLocation',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('title', models.CharField(max_length=500, verbose_name='Title')),
+                ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)),
+                ('address', models.TextField()),
+                ('mappable_location', models.CharField(help_text='This address will be used to calculate latitude and longitude. Leave blank and set Latitude and Longitude to specify the location yourself, or leave all three blank to auto-fill from the Location field.', max_length=128, blank=True)),
+                ('lat', models.DecimalField(decimal_places=7, max_digits=10, blank=True, help_text='Calculated automatically if mappable location is set.', null=True, verbose_name='Latitude')),
+                ('lon', models.DecimalField(decimal_places=7, max_digits=10, blank=True, help_text='Calculated automatically if mappable location is set.', null=True, verbose_name='Longitude')),
+                ('site', models.ForeignKey(editable=False, to='sites.Site')),
+            ],
+            options={
+                'ordering': ('title',),
+                'verbose_name': 'Event Location',
+                'verbose_name_plural': 'Event Locations',
+            },
+        ),
+        migrations.AddField(
+            model_name='event',
+            name='location',
+            field=models.ForeignKey(blank=True, to='mezzanine_agenda.EventLocation', null=True),
+        ),
+        migrations.AddField(
+            model_name='event',
+            name='site',
+            field=models.ForeignKey(editable=False, to='sites.Site'),
+        ),
+        migrations.AddField(
+            model_name='event',
+            name='user',
+            field=models.ForeignKey(related_name='events', verbose_name='Author', to=settings.AUTH_USER_MODEL),
+        ),
+    ]
diff --git a/app/migrations/mezzanine_agenda/0002_auto_20160224_1142.py b/app/migrations/mezzanine_agenda/0002_auto_20160224_1142.py
new file mode 100644 (file)
index 0000000..7ef6f21
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('mezzanine_agenda', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='event',
+            name='content_en',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+        migrations.AddField(
+            model_name='event',
+            name='content_fr',
+            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
+        ),
+    ]
diff --git a/app/migrations/mezzanine_agenda/__init__.py b/app/migrations/mezzanine_agenda/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 711ed88ee708afee78f3eaf7cd6f7b21a5718b85..e17d945c129bc799a2e699a016561f56e2c00861 100644 (file)
@@ -1,4 +1,5 @@
 import os
+from django.utils.translation import ugettext_lazy as _
 
 DEBUG = True
 
@@ -72,3 +73,13 @@ SITE_TITLE = 'Manifeste 2016'
 SITE_TAGLINE = 'Festival 2 juin | 2 juillet 2016'
 
 SILENCED_SYSTEM_CHECKS = ['fields.W342',]
+
+EVENT_USE_FEATURED_IMAGE = True
+
+ADMIN_MENU_ORDER = (
+    (_("Content"), ("pages.Page", "blog.BlogPost", "mezzanine_agenda.Event",
+        "festival.Artist", "festival.Video",
+        "generic.ThreadedComment", (_("Media Library"), "fb_browse"),)),
+    (_("Site"), ("sites.Site", "redirects.Redirect", "conf.Setting")),
+    (_("Users"), ("auth.User", "auth.Group",)),
+)
index bc1c3f6fbbf850624fea8a401dec70f30a056a18..016f557d95358f642496f16216a27734fae7bf77 100644 (file)
@@ -1,20 +1,27 @@
 from modeltranslation.translator import register, TranslationOptions
 
 from mezzanine_agenda.models import Event
-from festival.models import MetaEvent, Artist
+from festival.models import *
 
 
 @register(Event)
 class EventTranslationOptions(TranslationOptions):
 
-    fields = ('title',)
+    fields = ('title', 'content')
 
 
-@register(MetaEvent)
+@register(FestivalEvent)
 class MetaEventTranslationOptions(TranslationOptions):
     pass
 
 
 @register(Artist)
 class ArtistTranslationOptions(TranslationOptions):
-    pass
+
+    fields = ('title', 'description', 'bio', 'content')
+
+
+@register(Video)
+class VideoTranslationOptions(TranslationOptions):
+
+    fields = ('title', 'description', 'content')
index 0cf322b2bca7f47a95d2a51284af863b95a1de19..8d34662cc47f674e8653aaaff5b0fd8ca58ef059 100644 (file)
@@ -64,7 +64,9 @@ db:
 
 app:
   build: .
-  command: /bin/sh deploy/start_app.sh
+  command: /bin/sh deploy/start_app.sh --runserver
+  ports:
+    - "9000:9000"
   volumes:
     - ./app/:/srv/app
   volumes_from: