]> git.parisson.com Git - mezzo.git/commitdiff
make a unique organization module and related sub modules, reinit some migrations...
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 6 Jul 2016 16:49:30 +0000 (18:49 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 6 Jul 2016 16:49:30 +0000 (18:49 +0200)
140 files changed:
app/custom/__init__.py [deleted file]
app/custom/admin.py [deleted file]
app/custom/apps.py [deleted file]
app/custom/migrations/0001_initial.py [deleted file]
app/custom/migrations/0002_auto_20160705_1559.py [deleted file]
app/custom/migrations/0003_auto_20160705_1702.py [deleted file]
app/custom/migrations/0004_auto_20160705_1810.py [deleted file]
app/custom/migrations/__init__.py [deleted file]
app/custom/models.py [deleted file]
app/custom/tests.py [deleted file]
app/custom/translations.py [deleted file]
app/custom/views.py [deleted file]
app/festival/__init__.py [deleted file]
app/festival/admin.py [deleted file]
app/festival/management/__init__.py [deleted file]
app/festival/management/commands/__init__.py [deleted file]
app/festival/management/commands/create-admin-user.py [deleted file]
app/festival/management/commands/festival-sync-eve-events.py [deleted file]
app/festival/management/commands/wait-for-db.py [deleted file]
app/festival/migrations/0001_initial.py [deleted file]
app/festival/migrations/0002_auto_20160225_1602.py [deleted file]
app/festival/migrations/0003_auto_20160229_1430.py [deleted file]
app/festival/migrations/0004_auto_20160229_1630.py [deleted file]
app/festival/migrations/0005_auto_20160229_1636.py [deleted file]
app/festival/migrations/0006_auto_20160303_1442.py [deleted file]
app/festival/migrations/0007_auto_20160309_1441.py [deleted file]
app/festival/migrations/0008_auto_20160322_0018.py [deleted file]
app/festival/migrations/0009_auto_20160322_0021.py [deleted file]
app/festival/migrations/0010_playlist.py [deleted file]
app/festival/migrations/0011_auto_20160323_1159.py [deleted file]
app/festival/migrations/0012_auto_20160405_2351.py [deleted file]
app/festival/migrations/0013_auto_20160407_1432.py [deleted file]
app/festival/migrations/0014_auto_20160407_1433.py [deleted file]
app/festival/migrations/0015_auto_20160407_2249.py [deleted file]
app/festival/migrations/0016_auto_20160407_2255.py [deleted file]
app/festival/migrations/0017_auto_20160407_2256.py [deleted file]
app/festival/migrations/0018_auto_20160407_2301.py [deleted file]
app/festival/migrations/0019_auto_20160410_2148.py [deleted file]
app/festival/migrations/0020_auto_20160421_1059.py [deleted file]
app/festival/migrations/0021_delete_pagecategory.py [deleted file]
app/festival/migrations/0022_auto_20160517_1457.py [deleted file]
app/festival/migrations/__init__.py [deleted file]
app/festival/models.py [deleted file]
app/festival/related.py [deleted file]
app/festival/routers.py [deleted file]
app/festival/templatetags/festival_tags.py [deleted file]
app/festival/tests.py [deleted file]
app/festival/urls.py [deleted file]
app/festival/views.py [deleted file]
app/magazine/__init__.py [deleted file]
app/magazine/admin.py [deleted file]
app/magazine/apps.py [deleted file]
app/magazine/migrations/__init__.py [deleted file]
app/magazine/models.py [deleted file]
app/magazine/tests.py [deleted file]
app/magazine/views.py [deleted file]
app/media/__init__.py [deleted file]
app/media/admin.py [deleted file]
app/media/apps.py [deleted file]
app/media/migrations/__init__.py [deleted file]
app/media/models.py [deleted file]
app/media/tests.py [deleted file]
app/media/views.py [deleted file]
app/organization/__init__.py
app/organization/admin.py [deleted file]
app/organization/apps.py [deleted file]
app/organization/core/__init__.py [new file with mode: 0644]
app/organization/core/admin.py [new file with mode: 0644]
app/organization/core/apps.py [new file with mode: 0644]
app/organization/core/migrations/0001_initial.py [new file with mode: 0644]
app/organization/core/migrations/__init__.py [new file with mode: 0644]
app/organization/core/models.py [new file with mode: 0644]
app/organization/core/tests.py [new file with mode: 0644]
app/organization/core/translation.py [new file with mode: 0644]
app/organization/core/views.py [new file with mode: 0644]
app/organization/festival/__init__.py [new file with mode: 0644]
app/organization/festival/admin.py [new file with mode: 0644]
app/organization/festival/apps.py [new file with mode: 0644]
app/organization/festival/management/__init__.py [new file with mode: 0644]
app/organization/festival/management/commands/__init__.py [new file with mode: 0644]
app/organization/festival/management/commands/create-admin-user.py [new file with mode: 0644]
app/organization/festival/management/commands/festival-sync-eve-events.py [new file with mode: 0644]
app/organization/festival/management/commands/wait-for-db.py [new file with mode: 0644]
app/organization/festival/migrations/__init__.py [new file with mode: 0644]
app/organization/festival/models.py [new file with mode: 0644]
app/organization/festival/related.py [new file with mode: 0644]
app/organization/festival/routers.py [new file with mode: 0644]
app/organization/festival/templatetags/festival_tags.py [new file with mode: 0644]
app/organization/festival/tests.py [new file with mode: 0644]
app/organization/festival/translation.py [new file with mode: 0644]
app/organization/festival/urls.py [new file with mode: 0644]
app/organization/festival/views.py [new file with mode: 0644]
app/organization/magazine/__init__.py [new file with mode: 0644]
app/organization/magazine/admin.py [new file with mode: 0644]
app/organization/magazine/apps.py [new file with mode: 0644]
app/organization/magazine/migrations/0001_initial.py [new file with mode: 0644]
app/organization/magazine/migrations/__init__.py [new file with mode: 0644]
app/organization/magazine/models.py [new file with mode: 0644]
app/organization/magazine/tests.py [new file with mode: 0644]
app/organization/magazine/views.py [new file with mode: 0644]
app/organization/media/__init__.py [new file with mode: 0644]
app/organization/media/admin.py [new file with mode: 0644]
app/organization/media/apps.py [new file with mode: 0644]
app/organization/media/migrations/__init__.py [new file with mode: 0644]
app/organization/media/models.py [new file with mode: 0644]
app/organization/media/tests.py [new file with mode: 0644]
app/organization/media/views.py [new file with mode: 0644]
app/organization/migrations/0001_initial.py [deleted file]
app/organization/migrations/__init__.py [deleted file]
app/organization/models.py [deleted file]
app/organization/project/__init__.py [new file with mode: 0644]
app/organization/project/admin.py [new file with mode: 0644]
app/organization/project/apps.py [new file with mode: 0644]
app/organization/project/migrations/0001_initial.py [new file with mode: 0644]
app/organization/project/migrations/0002_auto_20160706_1848.py [new file with mode: 0644]
app/organization/project/migrations/__init__.py [new file with mode: 0644]
app/organization/project/models.py [new file with mode: 0644]
app/organization/project/tests.py [new file with mode: 0644]
app/organization/project/views.py [new file with mode: 0644]
app/organization/structure/__init__.py [new file with mode: 0644]
app/organization/structure/admin.py [new file with mode: 0644]
app/organization/structure/apps.py [new file with mode: 0644]
app/organization/structure/migrations/0001_initial.py [new file with mode: 0644]
app/organization/structure/migrations/__init__.py [new file with mode: 0644]
app/organization/structure/models.py [new file with mode: 0644]
app/organization/structure/tests.py [new file with mode: 0644]
app/organization/structure/views.py [new file with mode: 0644]
app/organization/tests.py [deleted file]
app/organization/views.py [deleted file]
app/project/__init__.py [deleted file]
app/project/admin.py [deleted file]
app/project/apps.py [deleted file]
app/project/migrations/__init__.py [deleted file]
app/project/models.py [deleted file]
app/project/tests.py [deleted file]
app/project/views.py [deleted file]
app/settings.py
app/structure/models.py [new file with mode: 0644]
app/translations.py [deleted file]
app/urls.py

diff --git a/app/custom/__init__.py b/app/custom/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/custom/admin.py b/app/custom/admin.py
deleted file mode 100644 (file)
index 7ca39c3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-from django.contrib import admin
-from copy import deepcopy
-from mezzanine.pages.models import Page
-from mezzanine.pages.admin import PageAdmin
-from mezzanine.pages.models import RichTextPage
-from custom.models import BasicPage
-
-
-# page_fieldsets = deepcopy(PageAdmin.fieldsets)
-# page_fieldsets[0][1]["fields"] += ("sub_title",)
-# print(page_fieldsets[0][1]["fields"])
-# PageAdmin.fieldsets = page_fieldsets
-#
-# admin.site.unregister(RichTextPage)
-# admin.site.register(RichTextPage, PageAdmin)
-
-
-admin.site.register(BasicPage, PageAdmin)
diff --git a/app/custom/apps.py b/app/custom/apps.py
deleted file mode 100644 (file)
index 245de53..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-from django.apps import AppConfig
-
-
-class CustomConfig(AppConfig):
-    name = 'custom'
diff --git a/app/custom/migrations/0001_initial.py b/app/custom/migrations/0001_initial.py
deleted file mode 100644 (file)
index 66ad115..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-05 13:58
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-import mezzanine.core.fields
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = [
-        ('pages', '0004_auto_20151223_1313'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='BasicPage',
-            fields=[
-                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='pages.Page')),
-                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
-                ('sub_title', models.TextField(blank=True, verbose_name='sub title')),
-            ],
-            options={
-                'ordering': ('_order',),
-            },
-            bases=('pages.page', models.Model),
-        ),
-    ]
diff --git a/app/custom/migrations/0002_auto_20160705_1559.py b/app/custom/migrations/0002_auto_20160705_1559.py
deleted file mode 100644 (file)
index 2f140ab..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-05 13:59
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('custom', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='basicpage',
-            name='sub_title_en',
-            field=models.TextField(blank=True, null=True, verbose_name='sub title'),
-        ),
-        migrations.AddField(
-            model_name='basicpage',
-            name='sub_title_fr',
-            field=models.TextField(blank=True, null=True, verbose_name='sub title'),
-        ),
-    ]
diff --git a/app/custom/migrations/0003_auto_20160705_1702.py b/app/custom/migrations/0003_auto_20160705_1702.py
deleted file mode 100644 (file)
index 260418e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-05 15:02
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('custom', '0002_auto_20160705_1559'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='basicpage',
-            name='sub_title',
-            field=models.CharField(blank=True, max_length=1000, verbose_name='sub title'),
-        ),
-        migrations.AlterField(
-            model_name='basicpage',
-            name='sub_title_en',
-            field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='sub title'),
-        ),
-        migrations.AlterField(
-            model_name='basicpage',
-            name='sub_title_fr',
-            field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='sub title'),
-        ),
-    ]
diff --git a/app/custom/migrations/0004_auto_20160705_1810.py b/app/custom/migrations/0004_auto_20160705_1810.py
deleted file mode 100644 (file)
index d3e93e9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-05 16:10
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import mezzanine.core.fields
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('custom', '0003_auto_20160705_1702'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='basicpage',
-            name='photo',
-            field=mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo'),
-        ),
-        migrations.AddField(
-            model_name='basicpage',
-            name='photo_alignment',
-            field=models.CharField(blank=True, choices=[('left', 'left'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment'),
-        ),
-        migrations.AddField(
-            model_name='basicpage',
-            name='photo_credits',
-            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits'),
-        ),
-        migrations.AddField(
-            model_name='basicpage',
-            name='photo_description',
-            field=models.TextField(blank=True, verbose_name='photo description'),
-        ),
-        migrations.AddField(
-            model_name='basicpage',
-            name='photo_featured',
-            field=mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo featured'),
-        ),
-        migrations.AddField(
-            model_name='basicpage',
-            name='photo_featured_credits',
-            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='photo featured credits'),
-        ),
-    ]
diff --git a/app/custom/migrations/__init__.py b/app/custom/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/custom/models.py b/app/custom/models.py
deleted file mode 100644 (file)
index 46b58bf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse, reverse_lazy
-from mezzanine.pages.models import Page, RichText
-from mezzanine.core.fields import RichTextField, OrderField, FileField
-from django.conf import settings
-
-from media.models import Photos
-
-ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
-MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
-
-
-class SubTitle(models.Model):
-
-    sub_title = models.TextField(_('sub title'), blank=True, max_length=1024)
-
-    class Meta:
-        abstract = True
-
-
-class BasicPage(Page, RichText, SubTitle, Photos):
-
-    class Meta:
-        verbose_name = 'basic page'
diff --git a/app/custom/tests.py b/app/custom/tests.py
deleted file mode 100644 (file)
index 7ce503c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/app/custom/translations.py b/app/custom/translations.py
deleted file mode 100644 (file)
index cbc624c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-from modeltranslation.translator import translator, register, TranslationOptions
-from mezzanine.pages.models import Page, RichText
-from mezzanine.pages.translation import TranslatedRichText
-from custom.models import BasicPage
-
-
-@register(BasicPage)
-class BasicPageTranslationOptions(TranslationOptions):
-
-    fields = ('sub_title',)
diff --git a/app/custom/views.py b/app/custom/views.py
deleted file mode 100644 (file)
index 91ea44a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.shortcuts import render
-
-# Create your views here.
diff --git a/app/festival/__init__.py b/app/festival/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/festival/admin.py b/app/festival/admin.py
deleted file mode 100644 (file)
index f15f1c3..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-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 *
-
-
-class ArtistAdmin(admin.ModelAdmin):
-
-    model = Artist
-
-
-class VideoAdmin(admin.ModelAdmin):
-
-    model = Video
-
-
-class VideoAdminDisplayable(DisplayableAdmin):
-
-    fieldsets = deepcopy(VideoAdmin.fieldsets)
-    filter_horizontal = ['artists']
-
-
-class AudioAdmin(admin.ModelAdmin):
-
-    model = Audio
-
-
-class AudioAdminDisplayable(DisplayableAdmin):
-
-    fieldsets = deepcopy(AudioAdmin.fieldsets)
-    filter_horizontal = ['artists']
-
-
-class ArtistAdminDisplayable(DisplayableAdmin):
-
-    fieldsets = deepcopy(ArtistAdmin.fieldsets)
-
-
-class PlaylistAdmin(admin.ModelAdmin):
-
-    model = Playlist
-    list_display = ('__unicode__',)
-    filter_horizontal = ['audios']
-
-
-class FeaturedAdmin(admin.ModelAdmin):
-
-    model = Featured
-    list_display = ('__unicode__',)
-    filter_horizontal = ['artists', 'events', 'videos', 'pages', 'blogposts', 'pages', 'playlists']
-
-
-admin.site.register(Artist, ArtistAdminDisplayable)
-admin.site.register(Video, VideoAdminDisplayable)
-admin.site.register(Audio, AudioAdminDisplayable)
-admin.site.register(Playlist, PlaylistAdmin)
-admin.site.register(Featured, FeaturedAdmin)
-admin.site.register(VideoCategory)
diff --git a/app/festival/management/__init__.py b/app/festival/management/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/festival/management/commands/__init__.py b/app/festival/management/commands/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/festival/management/commands/create-admin-user.py b/app/festival/management/commands/create-admin-user.py
deleted file mode 100644 (file)
index e7e3cad..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-from optparse import make_option
-from django.conf import settings
-from django.core.management.base import BaseCommand, CommandError
-from django.contrib.auth.models import User
-
-
-class Command(BaseCommand):
-    help = """Create a default admin user if it doesn't exist.
-            you SHOULD change the password and the email afterwards!"""
-
-    username = 'admin'
-    password = 'admin'
-    email = 'root@example.com'
-
-    def handle(self, *args, **options):
-        admin = User.objects.filter(username=self.username)
-        if not admin:
-            user = User(username=self.username)
-            user.set_password(self.password)
-            user.email = self.email
-            user.is_superuser = True
-            user.is_staff = True
-            user.save()
-            print('User ' + self.username + ' created')
diff --git a/app/festival/management/commands/festival-sync-eve-events.py b/app/festival/management/commands/festival-sync-eve-events.py
deleted file mode 100644 (file)
index 070cadb..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-from datetime import datetime, timedelta
-from optparse import make_option
-
-from django.conf import settings
-from django.core.management.base import BaseCommand, CommandError
-from django.contrib.auth.models import User
-from django.core.mail import EmailMessage
-
-import mezzanine_agenda.models as ma_models
-from mezzanine.generic.models import AssignedKeyword, Keyword
-
-import eve.models as eve_models
-
-
-class Command(BaseCommand):
-    """Synchronize events from E-vement to mezzanine_agenda"""
-
-
-    option_list = BaseCommand.option_list + (
-          make_option('-m', '--meta_event',
-            dest='meta_event',
-            help='define eve meta_event'),
-          )
-
-    default_user = User.objects.get(username='admin')
-
-    def cleanup(self):
-        # for event in ma_models.Event.objects.all():
-        #     event.delete()
-        # for location in ma_models.EventLocation.objects.all():
-        #     location.delete()
-        for event_price in ma_models.EventPrice.objects.all():
-            event_price.delete()
-
-    def handle(self, *args, **kwargs):
-        # self.cleanup()
-        meta_event_name = kwargs.get('meta_event')
-        meta_trans_all = eve_models.MetaEventTranslation.objects.all()
-        for meta_trans in meta_trans_all:
-            if meta_trans.name == meta_event_name:
-                break
-        eve_events = eve_models.Event.objects.filter(meta_event=meta_trans.id)
-        for eve_event in eve_events:
-            event_trans = eve_models.EventTranslation.objects.filter(id=eve_event, lang='fr')[0]
-            manifestations = eve_event.manifestations.all().order_by('happens_at')
-            first = True
-            for manifestation in manifestations:
-                events = ma_models.Event.objects.filter(external_id=manifestation.id)
-                if not events:
-                    event = ma_models.Event(external_id=manifestation.id)
-                else:
-                    event = events[0]
-                event.start = manifestation.happens_at
-                event.end = manifestation.happens_at + timedelta(seconds=manifestation.duration)
-                event.title = event_trans.name
-                event.user = self.default_user
-
-                locations = ma_models.EventLocation.objects.filter(title=manifestation.location.name)
-                if locations:
-                    location = locations[0]
-                else:
-                    location = ma_models.EventLocation(title=manifestation.location.name)
-                address = '\n'.join([manifestation.location.address, manifestation.location.postalcode + ' ' + manifestation.location.city])
-                location.address = address
-                location.external_id = manifestation.id
-                location.clean()
-                location.save()
-                event.location = location
-                event.save()
-                keyword, _ = Keyword.objects.get_or_create(title=eve_event.event_category.name)
-                event.keywords.add(AssignedKeyword(keyword=keyword), bulk=False)
-
-                eve_prices = eve_models.PriceManifestation.objects.filter(manifestation=manifestation)
-                for price in eve_prices:
-                    event_price, c = ma_models.EventPrice.objects.get_or_create(value=float(price.value))
-                    if event:
-                        if not event_price in event.prices.all():
-                            event.prices.add(event_price)
-
-                if not first:
-                    event.parent = parent
-                else:
-                    parent = event
-                    first = False
-
-                event.save()
diff --git a/app/festival/management/commands/wait-for-db.py b/app/festival/management/commands/wait-for-db.py
deleted file mode 100644 (file)
index e2bacf0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-import os, time
-
-from optparse import make_option
-from django.conf import settings
-from django.core.management.base import BaseCommand, CommandError
-from django.db import connections
-
-
-class Command(BaseCommand):
-    help = "wait for default DB connection"
-
-    db_name = 'default'
-    N = 20
-
-    def handle(self, *args, **options):
-        i = 0
-        connected = False
-        db_conn = connections[self.db_name]
-        while not connected:
-            try:
-                c = db_conn.cursor()
-                connected = True
-            except:
-                print('error connecting to DB...')
-                if i > self.N:
-                    print('...exiting')
-                    raise
-                print('...retrying')
-                i += 1
-                time.sleep(1)
diff --git a/app/festival/migrations/0001_initial.py b/app/festival/migrations/0001_initial.py
deleted file mode 100644 (file)
index 12a95a7..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import mezzanine.utils.models
-import django.db.models.deletion
-import mezzanine.core.fields
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('sites', '0001_initial'),
-        ('mezzanine_agenda', '0002_auto_20160224_1142'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Artist',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)),
-                ('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)),
-                ('description_fr', models.TextField(null=True, verbose_name='Description', blank=True)),
-                ('description_en', models.TextField(null=True, 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')),
-                ('content_fr', mezzanine.core.fields.RichTextField(null=True, verbose_name='Content')),
-                ('content_en', mezzanine.core.fields.RichTextField(null=True, verbose_name='Content')),
-                ('bio', mezzanine.core.fields.RichTextField(verbose_name='biography', blank=True)),
-                ('bio_fr', mezzanine.core.fields.RichTextField(null=True, verbose_name='biography', blank=True)),
-                ('bio_en', mezzanine.core.fields.RichTextField(null=True, verbose_name='biography', blank=True)),
-                ('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)),
-                ('featured', models.BooleanField(default=False, verbose_name='featured')),
-                ('site', models.ForeignKey(editable=False, to='sites.Site')),
-            ],
-            options={
-                'db_table': 'festival_artists',
-                'verbose_name': 'artist',
-            },
-            bases=(models.Model, mezzanine.utils.models.AdminThumbMixin),
-        ),
-        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='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.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.CreateModel(
-            name='Video',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)),
-                ('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)),
-                ('description_fr', models.TextField(null=True, verbose_name='Description', blank=True)),
-                ('description_en', models.TextField(null=True, 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')),
-                ('content_fr', mezzanine.core.fields.RichTextField(null=True, verbose_name='Content')),
-                ('content_en', mezzanine.core.fields.RichTextField(null=True, verbose_name='Content')),
-                ('media_id', models.IntegerField(verbose_name='media id')),
-                ('event', models.ForeignKey(related_name='videos', on_delete=django.db.models.deletion.SET_NULL, verbose_name='event', blank=True, to='mezzanine_agenda.Event', null=True)),
-                ('site', models.ForeignKey(editable=False, to='sites.Site')),
-            ],
-            options={
-                'abstract': False,
-            },
-        ),
-    ]
diff --git a/app/festival/migrations/0002_auto_20160225_1602.py b/app/festival/migrations/0002_auto_20160225_1602.py
deleted file mode 100644 (file)
index 5af49cf..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name='video',
-            options={'verbose_name': 'video'},
-        ),
-        migrations.AlterModelTable(
-            name='video',
-            table='festival_videos',
-        ),
-    ]
diff --git a/app/festival/migrations/0003_auto_20160229_1430.py b/app/festival/migrations/0003_auto_20160229_1430.py
deleted file mode 100644 (file)
index c8ff6ef..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0002_auto_20160225_1602'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='artist',
-            name='photo_description',
-            field=models.TextField(verbose_name='photo description', blank=True),
-        ),
-        migrations.AddField(
-            model_name='festivalevent',
-            name='featured_image_description',
-            field=models.TextField(verbose_name='featured image description', blank=True),
-        ),
-    ]
diff --git a/app/festival/migrations/0004_auto_20160229_1630.py b/app/festival/migrations/0004_auto_20160229_1630.py
deleted file mode 100644 (file)
index f34db56..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import mezzanine.core.fields
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0003_auto_20160229_1430'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='artist',
-            name='photo_alignment',
-            field=models.CharField(default=b'left', max_length=32, verbose_name='photo alignment', choices=[(b'left', 'left'), (b'right', 'right')]),
-        ),
-        migrations.AddField(
-            model_name='artist',
-            name='photo_featured',
-            field=mezzanine.core.fields.FileField(max_length=1024, verbose_name='photo featured', blank=True),
-        ),
-        migrations.AddField(
-            model_name='artist',
-            name='photo_featured_credits',
-            field=models.CharField(max_length=255, null=True, verbose_name='photo featured credits', blank=True),
-        ),
-    ]
diff --git a/app/festival/migrations/0005_auto_20160229_1636.py b/app/festival/migrations/0005_auto_20160229_1636.py
deleted file mode 100644 (file)
index 32426bb..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0004_auto_20160229_1630'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='artist',
-            name='photo_alignment',
-            field=models.CharField(default=b'left', max_length=32, verbose_name='photo alignment', blank=True, choices=[(b'left', 'left'), (b'right', 'right')]),
-        ),
-    ]
diff --git a/app/festival/migrations/0006_auto_20160303_1442.py b/app/festival/migrations/0006_auto_20160303_1442.py
deleted file mode 100644 (file)
index 876b18d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-03-03 13:42
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0005_auto_20160229_1636'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='artist',
-            name='photo_alignment',
-            field=models.CharField(blank=True, choices=[('left', 'left'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment'),
-        ),
-        migrations.AlterField(
-            model_name='festivalevent',
-            name='eve_event_id',
-            field=models.IntegerField(blank=True, null=True, verbose_name='eve id'),
-        ),
-        migrations.AlterField(
-            model_name='video',
-            name='media_id',
-            field=models.CharField(max_length=128, verbose_name='media id'),
-        ),
-    ]
diff --git a/app/festival/migrations/0007_auto_20160309_1441.py b/app/festival/migrations/0007_auto_20160309_1441.py
deleted file mode 100644 (file)
index 1713cb8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('mezzanine_agenda', '0002_auto_20160224_1142'),
-        ('festival', '0006_auto_20160303_1442'),
-    ]
-
-    operations = [
-        migrations.RemoveField(
-            model_name='festivalevent',
-            name='artists',
-        ),
-        migrations.RemoveField(
-            model_name='festivalevent',
-            name='category',
-        ),
-        migrations.RemoveField(
-            model_name='festivalevent',
-            name='event',
-        ),
-        migrations.AddField(
-            model_name='artist',
-            name='events',
-            field=models.ManyToManyField(related_name='artists', verbose_name='events', to='mezzanine_agenda.Event', blank=True),
-        ),
-        migrations.DeleteModel(
-            name='EventCategory',
-        ),
-        migrations.DeleteModel(
-            name='FestivalEvent',
-        ),
-    ]
diff --git a/app/festival/migrations/0008_auto_20160322_0018.py b/app/festival/migrations/0008_auto_20160322_0018.py
deleted file mode 100644 (file)
index 98de723..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-03-21 23:18
-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', '0003_auto_20160309_1621'),
-        ('sites', '0002_alter_domain_unique'),
-        ('festival', '0007_auto_20160309_1441'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Audio',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
-                ('title', models.CharField(max_length=500, verbose_name='Title')),
-                ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
-                ('_meta_title', models.CharField(blank=True, 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')),
-                ('description', models.TextField(blank=True, verbose_name='Description')),
-                ('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(editable=False, null=True)),
-                ('updated', models.DateTimeField(editable=False, null=True)),
-                ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
-                ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
-                ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
-                ('short_url', models.URLField(blank=True, null=True)),
-                ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
-                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
-                ('media_id', models.CharField(max_length=128, verbose_name='media id')),
-                ('open_source_url', models.URLField(blank=True, max_length=1024, verbose_name='open source URL')),
-                ('closed_source_url', models.URLField(blank=True, max_length=1024, verbose_name='closed source URL')),
-                ('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='audios', to='mezzanine_agenda.Event', verbose_name='event')),
-                ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
-            ],
-            options={
-                'db_table': 'festival_audios',
-                'verbose_name': 'audio',
-            },
-        ),
-        migrations.AddField(
-            model_name='video',
-            name='closed_source_url',
-            field=models.URLField(blank=True, max_length=1024, verbose_name='closed source URL'),
-        ),
-        migrations.AddField(
-            model_name='video',
-            name='open_source_url',
-            field=models.URLField(blank=True, max_length=1024, verbose_name='open source URL'),
-        ),
-    ]
diff --git a/app/festival/migrations/0009_auto_20160322_0021.py b/app/festival/migrations/0009_auto_20160322_0021.py
deleted file mode 100644 (file)
index d2be559..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-03-21 23:21
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import mezzanine.core.fields
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0008_auto_20160322_0018'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='audio',
-            name='content_en',
-            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
-        ),
-        migrations.AddField(
-            model_name='audio',
-            name='content_fr',
-            field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'),
-        ),
-        migrations.AddField(
-            model_name='audio',
-            name='description_en',
-            field=models.TextField(blank=True, null=True, verbose_name='Description'),
-        ),
-        migrations.AddField(
-            model_name='audio',
-            name='description_fr',
-            field=models.TextField(blank=True, null=True, verbose_name='Description'),
-        ),
-        migrations.AddField(
-            model_name='audio',
-            name='title_en',
-            field=models.CharField(max_length=500, null=True, verbose_name='Title'),
-        ),
-        migrations.AddField(
-            model_name='audio',
-            name='title_fr',
-            field=models.CharField(max_length=500, null=True, verbose_name='Title'),
-        ),
-    ]
diff --git a/app/festival/migrations/0010_playlist.py b/app/festival/migrations/0010_playlist.py
deleted file mode 100644 (file)
index e73b327..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-03-22 00:00
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('mezzanine_agenda', '0003_auto_20160309_1621'),
-        ('festival', '0009_auto_20160322_0021'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Playlist',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('title', models.CharField(max_length=512, verbose_name='title')),
-                ('description', models.TextField(blank=True, verbose_name='description')),
-                ('audios', models.ManyToManyField(blank=True, related_name='playlists', to='festival.Audio', verbose_name='audios')),
-                ('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='playlists', to='mezzanine_agenda.Event', verbose_name='event')),
-            ],
-            options={
-                'abstract': False,
-            },
-        ),
-    ]
diff --git a/app/festival/migrations/0011_auto_20160323_1159.py b/app/festival/migrations/0011_auto_20160323_1159.py
deleted file mode 100644 (file)
index 35fabf9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-03-23 10:59
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0010_playlist'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='artist',
-            name='first_name',
-            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='first name'),
-        ),
-        migrations.AddField(
-            model_name='artist',
-            name='last_name',
-            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='last name'),
-        ),
-    ]
diff --git a/app/festival/migrations/0012_auto_20160405_2351.py b/app/festival/migrations/0012_auto_20160405_2351.py
deleted file mode 100644 (file)
index 71de6cb..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-05 21:51
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0011_auto_20160323_1159'),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name='artist',
-            options={'ordering': ['last_name'], 'verbose_name': 'artist'},
-        ),
-        migrations.AddField(
-            model_name='audio',
-            name='featured',
-            field=models.BooleanField(default=False, verbose_name='featured'),
-        ),
-        migrations.AddField(
-            model_name='video',
-            name='featured',
-            field=models.BooleanField(default=False, verbose_name='featured'),
-        ),
-    ]
diff --git a/app/festival/migrations/0013_auto_20160407_1432.py b/app/festival/migrations/0013_auto_20160407_1432.py
deleted file mode 100644 (file)
index e03e859..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-07 12:32
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0012_auto_20160405_2351'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='audio',
-            name='poster',
-            field=models.URLField(blank=True, max_length=1024, verbose_name='poster'),
-        ),
-        migrations.AddField(
-            model_name='video',
-            name='poster',
-            field=models.URLField(blank=True, max_length=1024, verbose_name='poster'),
-        ),
-    ]
diff --git a/app/festival/migrations/0014_auto_20160407_1433.py b/app/festival/migrations/0014_auto_20160407_1433.py
deleted file mode 100644 (file)
index ac63f68..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-07 12:33
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0013_auto_20160407_1432'),
-    ]
-
-    operations = [
-        migrations.RenameField(
-            model_name='audio',
-            old_name='poster',
-            new_name='poster_url',
-        ),
-        migrations.RenameField(
-            model_name='video',
-            old_name='poster',
-            new_name='poster_url',
-        ),
-    ]
diff --git a/app/festival/migrations/0015_auto_20160407_2249.py b/app/festival/migrations/0015_auto_20160407_2249.py
deleted file mode 100644 (file)
index 7f6bd1d..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-07 20:49
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('blog', '0003_auto_20151223_1313'),
-        ('pages', '0004_auto_20151223_1313'),
-        ('mezzanine_agenda', '0006_remove_event_featured'),
-        ('festival', '0014_auto_20160407_1433'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Featured',
-            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={
-                'abstract': False,
-            },
-        ),
-        migrations.RemoveField(
-            model_name='artist',
-            name='featured',
-        ),
-        migrations.RemoveField(
-            model_name='audio',
-            name='featured',
-        ),
-        migrations.RemoveField(
-            model_name='video',
-            name='featured',
-        ),
-        migrations.AddField(
-            model_name='featured',
-            name='artists',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='festival.Artist', verbose_name='artists'),
-        ),
-        migrations.AddField(
-            model_name='featured',
-            name='blogpost',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='blog.BlogPost', verbose_name='blog post'),
-        ),
-        migrations.AddField(
-            model_name='featured',
-            name='events',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='mezzanine_agenda.Event', verbose_name='events'),
-        ),
-        migrations.AddField(
-            model_name='featured',
-            name='page',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='pages.Page', verbose_name='page'),
-        ),
-        migrations.AddField(
-            model_name='featured',
-            name='playlists',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='festival.Playlist', verbose_name='playlists'),
-        ),
-        migrations.AddField(
-            model_name='featured',
-            name='videos',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='festival.Video', verbose_name='videos'),
-        ),
-    ]
diff --git a/app/festival/migrations/0016_auto_20160407_2255.py b/app/festival/migrations/0016_auto_20160407_2255.py
deleted file mode 100644 (file)
index 3e0a2af..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-07 20:55
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0015_auto_20160407_2249'),
-    ]
-
-    operations = [
-        migrations.RenameField(
-            model_name='featured',
-            old_name='blogpost',
-            new_name='blogposts',
-        ),
-    ]
diff --git a/app/festival/migrations/0017_auto_20160407_2256.py b/app/festival/migrations/0017_auto_20160407_2256.py
deleted file mode 100644 (file)
index ec4ce28..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-07 20:56
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0016_auto_20160407_2255'),
-    ]
-
-    operations = [
-        migrations.RenameField(
-            model_name='featured',
-            old_name='page',
-            new_name='pages',
-        ),
-    ]
diff --git a/app/festival/migrations/0018_auto_20160407_2301.py b/app/festival/migrations/0018_auto_20160407_2301.py
deleted file mode 100644 (file)
index a449f01..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-07 21:01
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0017_auto_20160407_2256'),
-    ]
-
-    operations = [
-        migrations.AlterModelTable(
-            name='pagecategory',
-            table='festival_page_category',
-        ),
-    ]
diff --git a/app/festival/migrations/0019_auto_20160410_2148.py b/app/festival/migrations/0019_auto_20160410_2148.py
deleted file mode 100644 (file)
index 0dea9bb..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-10 19:48
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0018_auto_20160407_2301'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='featured',
-            name='blogposts',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='blog.BlogPost', verbose_name='blog posts'),
-        ),
-        migrations.AlterField(
-            model_name='featured',
-            name='pages',
-            field=models.ManyToManyField(blank=True, related_name='featured', to='pages.Page', verbose_name='pages'),
-        ),
-    ]
diff --git a/app/festival/migrations/0020_auto_20160421_1059.py b/app/festival/migrations/0020_auto_20160421_1059.py
deleted file mode 100644 (file)
index 176f87d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-21 08:59
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('sites', '0002_alter_domain_unique'),
-        ('festival', '0019_auto_20160410_2148'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='VideoCategory',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('title', models.CharField(max_length=500, verbose_name='Title')),
-                ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
-                ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
-            ],
-            options={
-                'verbose_name': 'video category',
-                'db_table': 'festival_video_category',
-            },
-        ),
-        migrations.AddField(
-            model_name='video',
-            name='category',
-            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='videos', to='festival.VideoCategory', verbose_name='category'),
-        ),
-    ]
diff --git a/app/festival/migrations/0021_delete_pagecategory.py b/app/festival/migrations/0021_delete_pagecategory.py
deleted file mode 100644 (file)
index 3cc9174..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-04-21 09:23
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0020_auto_20160421_1059'),
-    ]
-
-    operations = [
-        migrations.DeleteModel(
-            name='PageCategory',
-        ),
-    ]
diff --git a/app/festival/migrations/0022_auto_20160517_1457.py b/app/festival/migrations/0022_auto_20160517_1457.py
deleted file mode 100644 (file)
index 2dceb3c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.2 on 2016-05-17 12:57
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('festival', '0021_delete_pagecategory'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='audio',
-            name='artists',
-            field=models.ManyToManyField(blank=True, related_name='audios', to='festival.Artist', verbose_name='artists'),
-        ),
-        migrations.AddField(
-            model_name='video',
-            name='artists',
-            field=models.ManyToManyField(blank=True, related_name='videos', to='festival.Artist', verbose_name='artists'),
-        ),
-    ]
diff --git a/app/festival/migrations/__init__.py b/app/festival/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/festival/models.py b/app/festival/models.py
deleted file mode 100644 (file)
index 15a9656..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse, reverse_lazy
-from django.conf import settings
-
-from mezzanine.core.models import RichText, Displayable, Slugged
-from mezzanine.core.fields import RichTextField, OrderField, FileField
-from mezzanine.utils.models import AdminThumbMixin, upload_to
-from mezzanine.blog.models import BlogPost
-from mezzanine.pages.models import Page
-
-from mezzanine_agenda.models import Event
-
-import requests
-from pyquery import PyQuery as pq
-
-
-app_label = 'festival'
-ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
-MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
-
-
-class MetaCore:
-
-    app_label = 'festival'
-
-
-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 Artist(Displayable, RichText, AdminThumbMixin):
-    """Artist"""
-
-    first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
-    last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
-    bio = RichTextField(_('biography'), blank=True)
-    photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
-    photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
-    photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left", blank=True)
-    photo_description = models.TextField(_('photo description'), blank=True)
-    photo_featured = FileField(_('photo featured'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
-    photo_featured_credits = models.CharField(_('photo featured credits'), max_length=255, blank=True, null=True)
-    events = models.ManyToManyField(Event, related_name='artists', verbose_name=_('events'), blank=True)
-
-    search_fields = ("title", "bio")
-
-    class Meta(MetaCore):
-        verbose_name = _('artist')
-        db_table = app_label + '_artists'
-        ordering = ['last_name',]
-
-    def __unicode__(self):
-        return self.title
-
-    @property
-    def name(self):
-        return self.title
-
-    def get_absolute_url(self):
-        return reverse("festival-artist-detail", kwargs={'slug': self.slug})
-
-    def set_names(self):
-        names = self.title.split(' ')
-        if len(names) == 1:
-            self.first_name = ''
-            self.last_name = names[0]
-        elif len(names) == 2:
-            self.first_name = names[0]
-            self.last_name = names[1]
-        else:
-            self.first_name = names[0]
-            self.last_name = ' '.join(names[1:])
-
-    def clean(self):
-        super(Artist, self).clean()
-        self.set_names()
-
-    def save(self, *args, **kwargs):
-        self.set_names()
-        super(Artist, self).save(*args, **kwargs)
-
-    @property
-    def featured_image(self):
-        if self.photo_featured:
-            return self.photo_featured
-        else:
-            return self.photo
-
-
-class Media(Displayable, RichText):
-    """Media"""
-
-    media_id = models.CharField(_('media id'), max_length=128)
-    open_source_url = models.URLField(_('open source URL'), max_length=1024, blank=True)
-    closed_source_url = models.URLField(_('closed source URL'), max_length=1024, blank=True)
-    poster_url = models.URLField(_('poster'), max_length=1024, blank=True)
-
-    class Meta(MetaCore):
-        abstract = True
-
-    def __unicode__(self):
-        return self.title
-
-    @property
-    def uri(self):
-        return MEDIA_BASE_URL + self.media_id
-
-    def get_html(self):
-        r = requests.get(self.uri)
-        return r.content
-
-    def clean(self):
-        super(Media, self).clean()
-        self.q = pq(self.get_html())
-        sources = self.q('source')
-        for source in sources:
-            if self.open_source_mime_type in source.attrib['type']:
-                self.open_source_url = source.attrib['src']
-            elif self.closed_source_mime_type in source.attrib['type']:
-                self.closed_source_url = source.attrib['src']
-        video = self.q('video')
-        if len(video):
-            if 'poster' in video[0].attrib.keys():
-                self.poster_url = video[0].attrib['poster']
-
-
-class Audio(Media):
-    """Audio"""
-
-    open_source_mime_type = 'audio/ogg'
-    closed_source_mime_type = 'audio/mp4'
-
-    event = models.ForeignKey(Event, related_name='audios', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
-    artists = models.ManyToManyField(Artist, verbose_name=_('artists'), related_name='audios', blank=True)
-
-    class Meta(MetaCore):
-        verbose_name = _('audio')
-        db_table = app_label + '_audios'
-
-    def get_absolute_url(self):
-        return reverse("festival-video-detail", kwargs={"slug": self.slug})
-
-
-class Video(Media):
-    """Video"""
-
-    open_source_mime_type = 'video/webm'
-    closed_source_mime_type = 'video/mp4'
-
-    event = models.ForeignKey(Event, related_name='videos', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
-    category = models.ForeignKey('VideoCategory', related_name='videos', verbose_name=_('category'), blank=True, null=True, on_delete=models.SET_NULL)
-    artists = models.ManyToManyField(Artist, verbose_name=_('artists'), related_name='videos', blank=True)
-
-    class Meta(MetaCore):
-        verbose_name = _('video')
-        db_table = app_label + '_videos'
-
-    @property
-    def html(self):
-        #TODO: get html content from medias.ircam.fr with request module
-        pass
-
-    def get_absolute_url(self):
-        return reverse("festival-video-detail", kwargs={"slug": self.slug})
-
-
-class Playlist(BaseTitleModel):
-    """(Playlist description)"""
-
-    audios = models.ManyToManyField(Audio, verbose_name=_('audios'), related_name='playlists', blank=True)
-    event = models.ForeignKey(Event, related_name='playlists', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
-
-    def __str__(self):
-        return self.title
-
-
-class Featured(BaseNameModel):
-    """(Featured description)"""
-
-    artists = models.ManyToManyField(Artist, verbose_name=_('artists'), related_name='featured', blank=True)
-    events = models.ManyToManyField(Event, verbose_name=_('events'), related_name='featured', blank=True)
-    videos = models.ManyToManyField(Video, verbose_name=_('videos'), related_name='featured', blank=True)
-    blogposts = models.ManyToManyField(BlogPost, verbose_name=_('blog posts'), related_name='featured', blank=True)
-    pages = models.ManyToManyField(Page, verbose_name=_('pages'), related_name='featured', blank=True)
-    playlists = models.ManyToManyField(Playlist, verbose_name=_('playlists'), related_name='featured', blank=True)
-
-    def __unicode__(self):
-        return self.name
-
-
-class VideoCategory(Slugged):
-    """Video Category"""
-
-    class Meta(MetaCore):
-        verbose_name = _('video category')
-        db_table = app_label + '_video_category'
-
-    def count(self):
-        return self.videos.published().count()+1
diff --git a/app/festival/related.py b/app/festival/related.py
deleted file mode 100644 (file)
index 5b1affb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-from django.core import exceptions
-from django.db.models.fields.related import ForeignKey
-from django.db.utils import ConnectionHandler, ConnectionRouter
-
-connections = ConnectionHandler()
-router = ConnectionRouter()
-
-
-class SpanningForeignKey(ForeignKey):
-
-    def validate(self, value, model_instance):
-        if self.rel.parent_link:
-            return
-        # Call the grandparent rather than the parent to skip validation
-        super(ForeignKey, self).validate(value, model_instance)
-        if value is None:
-            return
-
-        using = router.db_for_read(self.rel.to, instance=model_instance)
-        qs = self.rel.to._default_manager.using(using).filter(
-            **{self.rel.field_name: value}
-        )
-        qs = qs.complex_filter(self.get_limit_choices_to())
-        if not qs.exists():
-            raise exceptions.ValidationError(
-                self.error_messages['invalid'],
-                code='invalid',
-                params={
-                    'model': self.rel.to._meta.verbose_name, 'pk': value,
-                    'field': self.rel.field_name, 'value': value,
-                },  # 'pk' is included for backwards compatibility
-            )
diff --git a/app/festival/routers.py b/app/festival/routers.py
deleted file mode 100644 (file)
index 6bde6a3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-
-class FestivalRouter(object):
-    """
-    A router to control all database operations on models in festival
-    """
-
-    def db_for_read(self, model, **hints):
-        if model._meta.app_label == 'festival':
-            return 'default'
-        return None
-
-    def db_for_write(self, model, **hints):
-        if model._meta.app_label == 'festival':
-            return 'default'
-        return None
-
-    def allow_relation(self, obj1, obj2, **hints):
-        if obj1._meta.app_label == 'festival' or \
-           obj2._meta.app_label == 'festival':
-           return True
-        return None
-
-    # def allow_migrate(self, db, app_label, model=None, **hints):
-    #     if app_label == 'festival':
-    #         return db == 'default'
-    #     return None
-
-    def allow_migrate(self, db, app_label, model_name=None, **hints):
-        if 'target_db' in hints:
-            return db == hints['target_db']
-        return True
diff --git a/app/festival/templatetags/festival_tags.py b/app/festival/templatetags/festival_tags.py
deleted file mode 100644 (file)
index 2737095..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-# -*- coding: utf-8 -*-
-from mezzanine.pages.models import Page
-from mezzanine.blog.models import BlogPost
-from mezzanine.template import Library
-from mezzanine_agenda.models import Event
-from festival.models import *
-from mezzanine.conf import settings
-from random import shuffle
-
-register = Library()
-
-
-@register.filter
-def subtract(value, arg):
-    return value - arg
-
-@register.as_tag
-def featured_edito(*args):
-    qs = Page.objects.filter(slug="edito")
-    if qs:
-        return qs[0].get_content_model()
-    else:
-        return None
-
-@register.as_tag
-def featured_events(*args):
-    featured = Featured.objects.all()
-    if featured:
-        return featured[0].events.order_by('start')
-    return None
-
-@register.as_tag
-def featured(*args):
-    featured_list = []
-    featured = Featured.objects.filter(id=settings.HOME_FEATURED_ID)
-    if featured:
-        featured = featured[0]
-        for post in featured.blogposts.all():
-            featured_list.append(post)
-        for video in featured.videos.all():
-            featured_list.append(video)
-        for artist in featured.artists.all():
-            featured_list.append(artist)
-        for playlist in featured.playlists.all():
-            featured_list.append(playlist)
-        shuffle(featured_list)
-    return featured_list
-
-@register.as_tag
-def featured_breaking_news_content(*args):
-    featured = Featured.objects.filter(id=settings.BREAKING_NEWS_FEATURED_ID)
-    if featured:
-        featured = featured[0]
-        news = featured.pages.all()
-        if news:
-            return news[0].richtextpage.content
-        else:
-            return ''
-    return ''
-
-@register.filter
-def get_class(obj):
-    return obj.__class__.__name__
-
-@register.filter
-def unique_posts(events):
-    post_list = []
-    for event in events:
-        for post in event.blog_posts.all():
-            print(post)
-            if not post in post_list:
-                post_list.append(post)
-    return post_list
-
-@register.filter
-def no_parents(events):
-    return events.filter(parent=None)
diff --git a/app/festival/tests.py b/app/festival/tests.py
deleted file mode 100644 (file)
index 7ce503c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/app/festival/urls.py b/app/festival/urls.py
deleted file mode 100644 (file)
index a02323c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-from __future__ import unicode_literals
-
-from django.conf.urls import patterns, include, url
-from django.conf.urls.i18n import i18n_patterns
-from django.contrib import admin
-
-from mezzanine.core.views import direct_to_template
-from mezzanine.conf import settings
-
-from festival.views import *
-
-urlpatterns = [
-    url(r'^artists/$', ArtistListView.as_view(), name="festival-artist-list"),
-    url(r'^artists/detail/(?P<slug>.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"),
-    url(r'^videos/$', VideoListView.as_view(), name="festival-video-list"),
-    url(r'^videos/detail/(?P<slug>.*)/$', VideoDetailView.as_view(), name="festival-video-detail"),
-    url(r'^videos/category/(?P<slug>.*)/$', VideoListCategoryView.as_view(), name="festival-video-list-category"),
-]
diff --git a/app/festival/views.py b/app/festival/views.py
deleted file mode 100644 (file)
index 75feeaa..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-from django.shortcuts import render
-from django.views.generic import *
-from django.views.generic.base import *
-from django.shortcuts import get_object_or_404
-
-from festival.models import *
-from mezzanine_agenda.models import EventLocation
-
-
-class SlugMixin(object):
-
-    def get_object(self):
-        objects = self.model.objects.all()
-        return get_object_or_404(objects, slug=self.kwargs['slug'])
-
-
-class ArtistListView(ListView):
-
-    model = Artist
-    template_name='festival/artist_list.html'
-
-    def get_queryset(self, **kwargs):
-        return self.model.objects.published()
-
-    def get_context_data(self, **kwargs):
-        context = super(ArtistListView, self).get_context_data(**kwargs)
-        return context
-
-
-class ArtistDetailView(SlugMixin, DetailView):
-
-    model = Artist
-    template_name='festival/artist_detail.html'
-    context_object_name = 'artist'
-
-    def get_context_data(self, **kwargs):
-        context = super(ArtistDetailView, self).get_context_data(**kwargs)
-        return context
-
-
-class VideoListView(ListView):
-
-    model = Video
-    template_name='festival/video_list.html'
-
-    def get_queryset(self, **kwargs):
-        return self.model.objects.published()
-
-    def get_context_data(self, **kwargs):
-        context = super(VideoListView, self).get_context_data(**kwargs)
-        context['categories'] = VideoCategory.objects.all()
-        return context
-
-
-class VideoDetailView(SlugMixin, DetailView):
-
-    model = Video
-    template_name='festival/video_detail.html'
-    context_object_name = 'video'
-
-    def get_context_data(self, **kwargs):
-        context = super(VideoDetailView, self).get_context_data(**kwargs)
-        return context
-
-
-class VideoListCategoryView(VideoListView):
-
-    def get_queryset(self):
-        self.category = VideoCategory.objects.get(slug=self.kwargs['slug'])
-        return self.model.objects.filter(category=self.category)
-
-    def get_context_data(self, **kwargs):
-        context = super(VideoListCategoryView, self).get_context_data(**kwargs)
-        context['category'] = self.category
-        return context
diff --git a/app/magazine/__init__.py b/app/magazine/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/magazine/admin.py b/app/magazine/admin.py
deleted file mode 100644 (file)
index 8c38f3f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/app/magazine/apps.py b/app/magazine/apps.py
deleted file mode 100644 (file)
index f4f5391..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-from __future__ import unicode_literals
-
-from django.apps import AppConfig
-
-
-class MagazineConfig(AppConfig):
-    name = 'magazine'
diff --git a/app/magazine/migrations/__init__.py b/app/magazine/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/magazine/models.py b/app/magazine/models.py
deleted file mode 100644 (file)
index 267d5cd..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-from __future__ import unicode_literals
-
-from django.db import models
-
-
-class Category(BaseNameModel):
-    """(Category description)"""
-
-    class Meta:
-        verbose_name = _('category')
-
-    def __unicode__(self):
-        return self.name
-
-
-class Topic(BaseNameModel):
-    """(Topic description)"""
-
-    class Meta:
-        verbose_name = _('topic')
-
-    def __unicode__(self):
-        return self.name
diff --git a/app/magazine/tests.py b/app/magazine/tests.py
deleted file mode 100644 (file)
index 7ce503c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/app/magazine/views.py b/app/magazine/views.py
deleted file mode 100644 (file)
index 91ea44a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.shortcuts import render
-
-# Create your views here.
diff --git a/app/media/__init__.py b/app/media/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/media/admin.py b/app/media/admin.py
deleted file mode 100644 (file)
index 8c38f3f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/app/media/apps.py b/app/media/apps.py
deleted file mode 100644 (file)
index c36a53e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-from __future__ import unicode_literals
-
-from django.apps import AppConfig
-
-
-class MediaConfig(AppConfig):
-    name = 'media'
diff --git a/app/media/migrations/__init__.py b/app/media/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/media/models.py b/app/media/models.py
deleted file mode 100644 (file)
index 3e1ad39..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-from __future__ import unicode_literals
-
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-
-from mezzanine.core.models import RichText, Displayable, Slugged
-from mezzanine.core.fields import RichTextField, OrderField, FileField
-from mezzanine.utils.models import AdminThumbMixin, upload_to
-
-ALIGNMENT_CHOICES = (('left', _('left')), ('center', _('center')), ('right', _('right')))
-
-
-class Photos(models.Model):
-    """Photo bundle with credits"""
-
-    photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
-    photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
-    photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left", blank=True)
-    photo_description = models.TextField(_('photo description'), blank=True)
-
-    photo_card = FileField(_('card photo'), upload_to='images/photos/card', max_length=1024, blank=True, format="Image")
-    photo_card_credits = models.CharField(_('photo card credits'), max_length=255, blank=True, null=True)
-
-    photo_slider = FileField(_('slider photo'), upload_to='images/photos/slider', max_length=1024, blank=True, format="Image")
-    photo_slider_credits = models.CharField(_('photo slider credits'), max_length=255, blank=True, null=True)
-
-    class Meta:
-        abstract = True
diff --git a/app/media/tests.py b/app/media/tests.py
deleted file mode 100644 (file)
index 7ce503c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/app/media/views.py b/app/media/views.py
deleted file mode 100644 (file)
index 91ea44a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.shortcuts import render
-
-# Create your views here.
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..efe892afb7c36464583291857c15b3b80b3704e3 100644 (file)
@@ -0,0 +1,2 @@
+
+__version__ = 0.1
diff --git a/app/organization/admin.py b/app/organization/admin.py
deleted file mode 100644 (file)
index 8c38f3f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/app/organization/apps.py b/app/organization/apps.py
deleted file mode 100644 (file)
index 3fd95b4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-from __future__ import unicode_literals
-
-from django.apps import AppConfig
-
-
-class OrganizationConfig(AppConfig):
-    name = 'organization'
diff --git a/app/organization/core/__init__.py b/app/organization/core/__init__.py
new file mode 100644 (file)
index 0000000..141c2fb
--- /dev/null
@@ -0,0 +1,7 @@
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+default_app_config = 'organization.core.apps.CoreConfig'
diff --git a/app/organization/core/admin.py b/app/organization/core/admin.py
new file mode 100644 (file)
index 0000000..fad5b45
--- /dev/null
@@ -0,0 +1,18 @@
+from django.contrib import admin
+from copy import deepcopy
+from mezzanine.pages.models import Page
+from mezzanine.pages.admin import PageAdmin
+from mezzanine.pages.models import RichTextPage
+from organization.core.models import BasicPage
+
+
+# page_fieldsets = deepcopy(PageAdmin.fieldsets)
+# page_fieldsets[0][1]["fields"] += ("sub_title",)
+# print(page_fieldsets[0][1]["fields"])
+# PageAdmin.fieldsets = page_fieldsets
+#
+# admin.site.unregister(RichTextPage)
+# admin.site.register(RichTextPage, PageAdmin)
+
+
+admin.site.register(BasicPage, PageAdmin)
diff --git a/app/organization/core/apps.py b/app/organization/core/apps.py
new file mode 100644 (file)
index 0000000..b05d77a
--- /dev/null
@@ -0,0 +1,9 @@
+from django.apps import AppConfig
+
+from django.core.checks import register
+
+
+class CoreConfig(AppConfig):
+
+    name = 'organization.core'
+    label = 'organization core'
diff --git a/app/organization/core/migrations/0001_initial.py b/app/organization/core/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..9f09456
--- /dev/null
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-06 16:48
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+        ('pages', '0004_auto_20151223_1313'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='BasicPage',
+            fields=[
+                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='pages.Page')),
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
+                ('photo', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo')),
+                ('photo_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits')),
+                ('photo_alignment', models.CharField(blank=True, choices=[('left', 'left'), ('center', 'center'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment')),
+                ('photo_description', models.TextField(blank=True, verbose_name='photo description')),
+                ('photo_card', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='card photo')),
+                ('photo_card_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo card credits')),
+                ('photo_slider', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='slider photo')),
+                ('photo_slider_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo slider credits')),
+                ('sub_title', models.TextField(blank=True, max_length=1024, verbose_name='sub title')),
+                ('sub_title_fr', models.TextField(blank=True, max_length=1024, null=True, verbose_name='sub title')),
+                ('sub_title_en', models.TextField(blank=True, max_length=1024, null=True, verbose_name='sub title')),
+            ],
+            options={
+                'verbose_name': 'basic page',
+                'ordering': ('_order',),
+            },
+            bases=('pages.page', models.Model),
+        ),
+    ]
diff --git a/app/organization/core/migrations/__init__.py b/app/organization/core/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/core/models.py b/app/organization/core/models.py
new file mode 100644 (file)
index 0000000..885583a
--- /dev/null
@@ -0,0 +1,43 @@
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse, reverse_lazy
+from mezzanine.pages.models import Page, RichText
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+from django.conf import settings
+
+from organization.media.models import Photos
+
+ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
+MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
+
+
+
+class Named(models.Model):
+    """Named object with description"""
+
+    name = models.CharField(_('name'), max_length=512)
+    description = models.TextField(_('description'), blank=True)
+
+    class Meta:
+        abstract = True
+
+    def __unicode__(self):
+        return self.name
+
+    @property
+    def slug(self):
+        return slugify(self.__unicode__())
+
+
+class SubTitle(models.Model):
+
+    sub_title = models.TextField(_('sub title'), blank=True, max_length=1024)
+
+    class Meta:
+        abstract = True
+
+
+class BasicPage(Page, RichText, SubTitle, Photos):
+
+    class Meta:
+        verbose_name = 'basic page'
diff --git a/app/organization/core/tests.py b/app/organization/core/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/app/organization/core/translation.py b/app/organization/core/translation.py
new file mode 100644 (file)
index 0000000..bce03de
--- /dev/null
@@ -0,0 +1,11 @@
+from modeltranslation.translator import translator, register, TranslationOptions
+from mezzanine.pages.models import Page, RichText
+from mezzanine.pages.translation import TranslatedRichText
+
+from organization.core.models import BasicPage
+
+
+@register(BasicPage)
+class BasicPageTranslationOptions(TranslationOptions):
+
+    fields = ('sub_title',)
diff --git a/app/organization/core/views.py b/app/organization/core/views.py
new file mode 100644 (file)
index 0000000..91ea44a
--- /dev/null
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
diff --git a/app/organization/festival/__init__.py b/app/organization/festival/__init__.py
new file mode 100644 (file)
index 0000000..28fa6ce
--- /dev/null
@@ -0,0 +1,10 @@
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+from mezzanine import __version__  # noqa
+
+
+default_app_config = 'organization.festival.apps.FestivalConfig'
diff --git a/app/organization/festival/admin.py b/app/organization/festival/admin.py
new file mode 100644 (file)
index 0000000..70fb8fc
--- /dev/null
@@ -0,0 +1,68 @@
+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 organization.festival.models import *
+
+
+class ArtistAdmin(admin.ModelAdmin):
+
+    model = Artist
+
+
+class VideoAdmin(admin.ModelAdmin):
+
+    model = Video
+
+
+class VideoAdminDisplayable(DisplayableAdmin):
+
+    fieldsets = deepcopy(VideoAdmin.fieldsets)
+    filter_horizontal = ['artists']
+
+
+class AudioAdmin(admin.ModelAdmin):
+
+    model = Audio
+
+
+class AudioAdminDisplayable(DisplayableAdmin):
+
+    fieldsets = deepcopy(AudioAdmin.fieldsets)
+    filter_horizontal = ['artists']
+
+
+class ArtistAdminDisplayable(DisplayableAdmin):
+
+    fieldsets = deepcopy(ArtistAdmin.fieldsets)
+
+
+class PlaylistAdmin(admin.ModelAdmin):
+
+    model = Playlist
+    list_display = ('__unicode__',)
+    filter_horizontal = ['audios']
+
+
+class FeaturedAdmin(admin.ModelAdmin):
+
+    model = Featured
+    list_display = ('__unicode__',)
+    filter_horizontal = ['artists', 'events', 'videos', 'pages', 'blogposts', 'pages', 'playlists']
+
+
+admin.site.register(Artist, ArtistAdminDisplayable)
+admin.site.register(Video, VideoAdminDisplayable)
+admin.site.register(Audio, AudioAdminDisplayable)
+admin.site.register(Playlist, PlaylistAdmin)
+admin.site.register(Featured, FeaturedAdmin)
+admin.site.register(VideoCategory)
diff --git a/app/organization/festival/apps.py b/app/organization/festival/apps.py
new file mode 100644 (file)
index 0000000..a6fe16f
--- /dev/null
@@ -0,0 +1,7 @@
+from django.apps import AppConfig
+
+
+class FestivalConfig(AppConfig):
+
+    name = 'organization.festival'
+    label = 'organization festival'
diff --git a/app/organization/festival/management/__init__.py b/app/organization/festival/management/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/festival/management/commands/__init__.py b/app/organization/festival/management/commands/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/festival/management/commands/create-admin-user.py b/app/organization/festival/management/commands/create-admin-user.py
new file mode 100644 (file)
index 0000000..e7e3cad
--- /dev/null
@@ -0,0 +1,24 @@
+from optparse import make_option
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.contrib.auth.models import User
+
+
+class Command(BaseCommand):
+    help = """Create a default admin user if it doesn't exist.
+            you SHOULD change the password and the email afterwards!"""
+
+    username = 'admin'
+    password = 'admin'
+    email = 'root@example.com'
+
+    def handle(self, *args, **options):
+        admin = User.objects.filter(username=self.username)
+        if not admin:
+            user = User(username=self.username)
+            user.set_password(self.password)
+            user.email = self.email
+            user.is_superuser = True
+            user.is_staff = True
+            user.save()
+            print('User ' + self.username + ' created')
diff --git a/app/organization/festival/management/commands/festival-sync-eve-events.py b/app/organization/festival/management/commands/festival-sync-eve-events.py
new file mode 100644 (file)
index 0000000..070cadb
--- /dev/null
@@ -0,0 +1,86 @@
+from datetime import datetime, timedelta
+from optparse import make_option
+
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.contrib.auth.models import User
+from django.core.mail import EmailMessage
+
+import mezzanine_agenda.models as ma_models
+from mezzanine.generic.models import AssignedKeyword, Keyword
+
+import eve.models as eve_models
+
+
+class Command(BaseCommand):
+    """Synchronize events from E-vement to mezzanine_agenda"""
+
+
+    option_list = BaseCommand.option_list + (
+          make_option('-m', '--meta_event',
+            dest='meta_event',
+            help='define eve meta_event'),
+          )
+
+    default_user = User.objects.get(username='admin')
+
+    def cleanup(self):
+        # for event in ma_models.Event.objects.all():
+        #     event.delete()
+        # for location in ma_models.EventLocation.objects.all():
+        #     location.delete()
+        for event_price in ma_models.EventPrice.objects.all():
+            event_price.delete()
+
+    def handle(self, *args, **kwargs):
+        # self.cleanup()
+        meta_event_name = kwargs.get('meta_event')
+        meta_trans_all = eve_models.MetaEventTranslation.objects.all()
+        for meta_trans in meta_trans_all:
+            if meta_trans.name == meta_event_name:
+                break
+        eve_events = eve_models.Event.objects.filter(meta_event=meta_trans.id)
+        for eve_event in eve_events:
+            event_trans = eve_models.EventTranslation.objects.filter(id=eve_event, lang='fr')[0]
+            manifestations = eve_event.manifestations.all().order_by('happens_at')
+            first = True
+            for manifestation in manifestations:
+                events = ma_models.Event.objects.filter(external_id=manifestation.id)
+                if not events:
+                    event = ma_models.Event(external_id=manifestation.id)
+                else:
+                    event = events[0]
+                event.start = manifestation.happens_at
+                event.end = manifestation.happens_at + timedelta(seconds=manifestation.duration)
+                event.title = event_trans.name
+                event.user = self.default_user
+
+                locations = ma_models.EventLocation.objects.filter(title=manifestation.location.name)
+                if locations:
+                    location = locations[0]
+                else:
+                    location = ma_models.EventLocation(title=manifestation.location.name)
+                address = '\n'.join([manifestation.location.address, manifestation.location.postalcode + ' ' + manifestation.location.city])
+                location.address = address
+                location.external_id = manifestation.id
+                location.clean()
+                location.save()
+                event.location = location
+                event.save()
+                keyword, _ = Keyword.objects.get_or_create(title=eve_event.event_category.name)
+                event.keywords.add(AssignedKeyword(keyword=keyword), bulk=False)
+
+                eve_prices = eve_models.PriceManifestation.objects.filter(manifestation=manifestation)
+                for price in eve_prices:
+                    event_price, c = ma_models.EventPrice.objects.get_or_create(value=float(price.value))
+                    if event:
+                        if not event_price in event.prices.all():
+                            event.prices.add(event_price)
+
+                if not first:
+                    event.parent = parent
+                else:
+                    parent = event
+                    first = False
+
+                event.save()
diff --git a/app/organization/festival/management/commands/wait-for-db.py b/app/organization/festival/management/commands/wait-for-db.py
new file mode 100644 (file)
index 0000000..e2bacf0
--- /dev/null
@@ -0,0 +1,30 @@
+import os, time
+
+from optparse import make_option
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.db import connections
+
+
+class Command(BaseCommand):
+    help = "wait for default DB connection"
+
+    db_name = 'default'
+    N = 20
+
+    def handle(self, *args, **options):
+        i = 0
+        connected = False
+        db_conn = connections[self.db_name]
+        while not connected:
+            try:
+                c = db_conn.cursor()
+                connected = True
+            except:
+                print('error connecting to DB...')
+                if i > self.N:
+                    print('...exiting')
+                    raise
+                print('...retrying')
+                i += 1
+                time.sleep(1)
diff --git a/app/organization/festival/migrations/__init__.py b/app/organization/festival/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/festival/models.py b/app/organization/festival/models.py
new file mode 100644 (file)
index 0000000..15a9656
--- /dev/null
@@ -0,0 +1,221 @@
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse, reverse_lazy
+from django.conf import settings
+
+from mezzanine.core.models import RichText, Displayable, Slugged
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+from mezzanine.utils.models import AdminThumbMixin, upload_to
+from mezzanine.blog.models import BlogPost
+from mezzanine.pages.models import Page
+
+from mezzanine_agenda.models import Event
+
+import requests
+from pyquery import PyQuery as pq
+
+
+app_label = 'festival'
+ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
+MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
+
+
+class MetaCore:
+
+    app_label = 'festival'
+
+
+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 Artist(Displayable, RichText, AdminThumbMixin):
+    """Artist"""
+
+    first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
+    last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
+    bio = RichTextField(_('biography'), blank=True)
+    photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
+    photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
+    photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left", blank=True)
+    photo_description = models.TextField(_('photo description'), blank=True)
+    photo_featured = FileField(_('photo featured'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
+    photo_featured_credits = models.CharField(_('photo featured credits'), max_length=255, blank=True, null=True)
+    events = models.ManyToManyField(Event, related_name='artists', verbose_name=_('events'), blank=True)
+
+    search_fields = ("title", "bio")
+
+    class Meta(MetaCore):
+        verbose_name = _('artist')
+        db_table = app_label + '_artists'
+        ordering = ['last_name',]
+
+    def __unicode__(self):
+        return self.title
+
+    @property
+    def name(self):
+        return self.title
+
+    def get_absolute_url(self):
+        return reverse("festival-artist-detail", kwargs={'slug': self.slug})
+
+    def set_names(self):
+        names = self.title.split(' ')
+        if len(names) == 1:
+            self.first_name = ''
+            self.last_name = names[0]
+        elif len(names) == 2:
+            self.first_name = names[0]
+            self.last_name = names[1]
+        else:
+            self.first_name = names[0]
+            self.last_name = ' '.join(names[1:])
+
+    def clean(self):
+        super(Artist, self).clean()
+        self.set_names()
+
+    def save(self, *args, **kwargs):
+        self.set_names()
+        super(Artist, self).save(*args, **kwargs)
+
+    @property
+    def featured_image(self):
+        if self.photo_featured:
+            return self.photo_featured
+        else:
+            return self.photo
+
+
+class Media(Displayable, RichText):
+    """Media"""
+
+    media_id = models.CharField(_('media id'), max_length=128)
+    open_source_url = models.URLField(_('open source URL'), max_length=1024, blank=True)
+    closed_source_url = models.URLField(_('closed source URL'), max_length=1024, blank=True)
+    poster_url = models.URLField(_('poster'), max_length=1024, blank=True)
+
+    class Meta(MetaCore):
+        abstract = True
+
+    def __unicode__(self):
+        return self.title
+
+    @property
+    def uri(self):
+        return MEDIA_BASE_URL + self.media_id
+
+    def get_html(self):
+        r = requests.get(self.uri)
+        return r.content
+
+    def clean(self):
+        super(Media, self).clean()
+        self.q = pq(self.get_html())
+        sources = self.q('source')
+        for source in sources:
+            if self.open_source_mime_type in source.attrib['type']:
+                self.open_source_url = source.attrib['src']
+            elif self.closed_source_mime_type in source.attrib['type']:
+                self.closed_source_url = source.attrib['src']
+        video = self.q('video')
+        if len(video):
+            if 'poster' in video[0].attrib.keys():
+                self.poster_url = video[0].attrib['poster']
+
+
+class Audio(Media):
+    """Audio"""
+
+    open_source_mime_type = 'audio/ogg'
+    closed_source_mime_type = 'audio/mp4'
+
+    event = models.ForeignKey(Event, related_name='audios', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
+    artists = models.ManyToManyField(Artist, verbose_name=_('artists'), related_name='audios', blank=True)
+
+    class Meta(MetaCore):
+        verbose_name = _('audio')
+        db_table = app_label + '_audios'
+
+    def get_absolute_url(self):
+        return reverse("festival-video-detail", kwargs={"slug": self.slug})
+
+
+class Video(Media):
+    """Video"""
+
+    open_source_mime_type = 'video/webm'
+    closed_source_mime_type = 'video/mp4'
+
+    event = models.ForeignKey(Event, related_name='videos', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
+    category = models.ForeignKey('VideoCategory', related_name='videos', verbose_name=_('category'), blank=True, null=True, on_delete=models.SET_NULL)
+    artists = models.ManyToManyField(Artist, verbose_name=_('artists'), related_name='videos', blank=True)
+
+    class Meta(MetaCore):
+        verbose_name = _('video')
+        db_table = app_label + '_videos'
+
+    @property
+    def html(self):
+        #TODO: get html content from medias.ircam.fr with request module
+        pass
+
+    def get_absolute_url(self):
+        return reverse("festival-video-detail", kwargs={"slug": self.slug})
+
+
+class Playlist(BaseTitleModel):
+    """(Playlist description)"""
+
+    audios = models.ManyToManyField(Audio, verbose_name=_('audios'), related_name='playlists', blank=True)
+    event = models.ForeignKey(Event, related_name='playlists', verbose_name=_('event'), blank=True, null=True, on_delete=models.SET_NULL)
+
+    def __str__(self):
+        return self.title
+
+
+class Featured(BaseNameModel):
+    """(Featured description)"""
+
+    artists = models.ManyToManyField(Artist, verbose_name=_('artists'), related_name='featured', blank=True)
+    events = models.ManyToManyField(Event, verbose_name=_('events'), related_name='featured', blank=True)
+    videos = models.ManyToManyField(Video, verbose_name=_('videos'), related_name='featured', blank=True)
+    blogposts = models.ManyToManyField(BlogPost, verbose_name=_('blog posts'), related_name='featured', blank=True)
+    pages = models.ManyToManyField(Page, verbose_name=_('pages'), related_name='featured', blank=True)
+    playlists = models.ManyToManyField(Playlist, verbose_name=_('playlists'), related_name='featured', blank=True)
+
+    def __unicode__(self):
+        return self.name
+
+
+class VideoCategory(Slugged):
+    """Video Category"""
+
+    class Meta(MetaCore):
+        verbose_name = _('video category')
+        db_table = app_label + '_video_category'
+
+    def count(self):
+        return self.videos.published().count()+1
diff --git a/app/organization/festival/related.py b/app/organization/festival/related.py
new file mode 100644 (file)
index 0000000..5b1affb
--- /dev/null
@@ -0,0 +1,32 @@
+from django.core import exceptions
+from django.db.models.fields.related import ForeignKey
+from django.db.utils import ConnectionHandler, ConnectionRouter
+
+connections = ConnectionHandler()
+router = ConnectionRouter()
+
+
+class SpanningForeignKey(ForeignKey):
+
+    def validate(self, value, model_instance):
+        if self.rel.parent_link:
+            return
+        # Call the grandparent rather than the parent to skip validation
+        super(ForeignKey, self).validate(value, model_instance)
+        if value is None:
+            return
+
+        using = router.db_for_read(self.rel.to, instance=model_instance)
+        qs = self.rel.to._default_manager.using(using).filter(
+            **{self.rel.field_name: value}
+        )
+        qs = qs.complex_filter(self.get_limit_choices_to())
+        if not qs.exists():
+            raise exceptions.ValidationError(
+                self.error_messages['invalid'],
+                code='invalid',
+                params={
+                    'model': self.rel.to._meta.verbose_name, 'pk': value,
+                    'field': self.rel.field_name, 'value': value,
+                },  # 'pk' is included for backwards compatibility
+            )
diff --git a/app/organization/festival/routers.py b/app/organization/festival/routers.py
new file mode 100644 (file)
index 0000000..6bde6a3
--- /dev/null
@@ -0,0 +1,31 @@
+
+class FestivalRouter(object):
+    """
+    A router to control all database operations on models in festival
+    """
+
+    def db_for_read(self, model, **hints):
+        if model._meta.app_label == 'festival':
+            return 'default'
+        return None
+
+    def db_for_write(self, model, **hints):
+        if model._meta.app_label == 'festival':
+            return 'default'
+        return None
+
+    def allow_relation(self, obj1, obj2, **hints):
+        if obj1._meta.app_label == 'festival' or \
+           obj2._meta.app_label == 'festival':
+           return True
+        return None
+
+    # def allow_migrate(self, db, app_label, model=None, **hints):
+    #     if app_label == 'festival':
+    #         return db == 'default'
+    #     return None
+
+    def allow_migrate(self, db, app_label, model_name=None, **hints):
+        if 'target_db' in hints:
+            return db == hints['target_db']
+        return True
diff --git a/app/organization/festival/templatetags/festival_tags.py b/app/organization/festival/templatetags/festival_tags.py
new file mode 100644 (file)
index 0000000..824c59a
--- /dev/null
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+from mezzanine.pages.models import Page
+from mezzanine.blog.models import BlogPost
+from mezzanine.template import Library
+from mezzanine_agenda.models import Event
+from mezzanine.conf import settings
+from random import shuffle
+
+from organization.festival.models import *
+
+register = Library()
+
+
+@register.filter
+def subtract(value, arg):
+    return value - arg
+
+@register.as_tag
+def featured_edito(*args):
+    qs = Page.objects.filter(slug="edito")
+    if qs:
+        return qs[0].get_content_model()
+    else:
+        return None
+
+@register.as_tag
+def featured_events(*args):
+    featured = Featured.objects.all()
+    if featured:
+        return featured[0].events.order_by('start')
+    return None
+
+@register.as_tag
+def featured(*args):
+    featured_list = []
+    featured = Featured.objects.filter(id=settings.HOME_FEATURED_ID)
+    if featured:
+        featured = featured[0]
+        for post in featured.blogposts.all():
+            featured_list.append(post)
+        for video in featured.videos.all():
+            featured_list.append(video)
+        for artist in featured.artists.all():
+            featured_list.append(artist)
+        for playlist in featured.playlists.all():
+            featured_list.append(playlist)
+        shuffle(featured_list)
+    return featured_list
+
+@register.as_tag
+def featured_breaking_news_content(*args):
+    featured = Featured.objects.filter(id=settings.BREAKING_NEWS_FEATURED_ID)
+    if featured:
+        featured = featured[0]
+        news = featured.pages.all()
+        if news:
+            return news[0].richtextpage.content
+        else:
+            return ''
+    return ''
+
+@register.filter
+def get_class(obj):
+    return obj.__class__.__name__
+
+@register.filter
+def unique_posts(events):
+    post_list = []
+    for event in events:
+        for post in event.blog_posts.all():
+            print(post)
+            if not post in post_list:
+                post_list.append(post)
+    return post_list
+
+@register.filter
+def no_parents(events):
+    return events.filter(parent=None)
diff --git a/app/organization/festival/tests.py b/app/organization/festival/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/app/organization/festival/translation.py b/app/organization/festival/translation.py
new file mode 100644 (file)
index 0000000..fabf2bf
--- /dev/null
@@ -0,0 +1,32 @@
+from modeltranslation.translator import register, TranslationOptions
+
+from mezzanine_agenda.models import Event, EventLocation
+from organization.festival.models import *
+
+
+@register(Event)
+class EventTranslationOptions(TranslationOptions):
+
+    fields = ('title', 'description', 'content')
+
+@register(EventLocation)
+class EventLocationTranslationOptions(TranslationOptions):
+
+    fields = ('description',)
+
+@register(Artist)
+class ArtistTranslationOptions(TranslationOptions):
+
+    fields = ('title', 'description', 'bio', 'content')
+
+
+@register(Video)
+class VideoTranslationOptions(TranslationOptions):
+
+    fields = ('title', 'description', 'content')
+
+
+@register(Audio)
+class AudioTranslationOptions(TranslationOptions):
+
+    fields = ('title', 'description', 'content')
diff --git a/app/organization/festival/urls.py b/app/organization/festival/urls.py
new file mode 100644 (file)
index 0000000..dbf17f4
--- /dev/null
@@ -0,0 +1,19 @@
+from __future__ import unicode_literals
+
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+from django.contrib import admin
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+from organization.festival.views import *
+
+
+urlpatterns = [
+    url(r'^artists/$', ArtistListView.as_view(), name="festival-artist-list"),
+    url(r'^artists/detail/(?P<slug>.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"),
+    url(r'^videos/$', VideoListView.as_view(), name="festival-video-list"),
+    url(r'^videos/detail/(?P<slug>.*)/$', VideoDetailView.as_view(), name="festival-video-detail"),
+    url(r'^videos/category/(?P<slug>.*)/$', VideoListCategoryView.as_view(), name="festival-video-list-category"),
+]
diff --git a/app/organization/festival/views.py b/app/organization/festival/views.py
new file mode 100644 (file)
index 0000000..0c55cf8
--- /dev/null
@@ -0,0 +1,75 @@
+from django.shortcuts import render
+from django.views.generic import *
+from django.views.generic.base import *
+from django.shortcuts import get_object_or_404
+
+from organization.festival.models import *
+from mezzanine_agenda.models import EventLocation
+
+
+class SlugMixin(object):
+
+    def get_object(self):
+        objects = self.model.objects.all()
+        return get_object_or_404(objects, slug=self.kwargs['slug'])
+
+
+class ArtistListView(ListView):
+
+    model = Artist
+    template_name='festival/artist_list.html'
+
+    def get_queryset(self, **kwargs):
+        return self.model.objects.published()
+
+    def get_context_data(self, **kwargs):
+        context = super(ArtistListView, self).get_context_data(**kwargs)
+        return context
+
+
+class ArtistDetailView(SlugMixin, DetailView):
+
+    model = Artist
+    template_name='festival/artist_detail.html'
+    context_object_name = 'artist'
+
+    def get_context_data(self, **kwargs):
+        context = super(ArtistDetailView, self).get_context_data(**kwargs)
+        return context
+
+
+class VideoListView(ListView):
+
+    model = Video
+    template_name='festival/video_list.html'
+
+    def get_queryset(self, **kwargs):
+        return self.model.objects.published()
+
+    def get_context_data(self, **kwargs):
+        context = super(VideoListView, self).get_context_data(**kwargs)
+        context['categories'] = VideoCategory.objects.all()
+        return context
+
+
+class VideoDetailView(SlugMixin, DetailView):
+
+    model = Video
+    template_name='festival/video_detail.html'
+    context_object_name = 'video'
+
+    def get_context_data(self, **kwargs):
+        context = super(VideoDetailView, self).get_context_data(**kwargs)
+        return context
+
+
+class VideoListCategoryView(VideoListView):
+
+    def get_queryset(self):
+        self.category = VideoCategory.objects.get(slug=self.kwargs['slug'])
+        return self.model.objects.filter(category=self.category)
+
+    def get_context_data(self, **kwargs):
+        context = super(VideoListCategoryView, self).get_context_data(**kwargs)
+        context['category'] = self.category
+        return context
diff --git a/app/organization/magazine/__init__.py b/app/organization/magazine/__init__.py
new file mode 100644 (file)
index 0000000..043bee8
--- /dev/null
@@ -0,0 +1,10 @@
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+from mezzanine import __version__  # noqa
+
+
+default_app_config = 'organization.magazine.apps.MagazineConfig'
diff --git a/app/organization/magazine/admin.py b/app/organization/magazine/admin.py
new file mode 100644 (file)
index 0000000..8c38f3f
--- /dev/null
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/app/organization/magazine/apps.py b/app/organization/magazine/apps.py
new file mode 100644 (file)
index 0000000..508c40a
--- /dev/null
@@ -0,0 +1,8 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class MagazineConfig(AppConfig):
+
+    name = 'organization.magazine'
diff --git a/app/organization/magazine/migrations/0001_initial.py b/app/organization/magazine/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..683c85d
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-06 16:48
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Category',
+            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': 'category',
+            },
+        ),
+        migrations.CreateModel(
+            name='Topic',
+            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': 'topic',
+            },
+        ),
+    ]
diff --git a/app/organization/magazine/migrations/__init__.py b/app/organization/magazine/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/magazine/models.py b/app/organization/magazine/models.py
new file mode 100644 (file)
index 0000000..fe40d65
--- /dev/null
@@ -0,0 +1,26 @@
+from __future__ import unicode_literals
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+from organization.core.models import Named
+
+
+class Category(Named):
+    """(Category description)"""
+
+    class Meta:
+        verbose_name = _('category')
+
+    def __unicode__(self):
+        return self.name
+
+
+class Topic(Named):
+    """(Topic description)"""
+
+    class Meta:
+        verbose_name = _('topic')
+
+    def __unicode__(self):
+        return self.name
diff --git a/app/organization/magazine/tests.py b/app/organization/magazine/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/app/organization/magazine/views.py b/app/organization/magazine/views.py
new file mode 100644 (file)
index 0000000..91ea44a
--- /dev/null
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
diff --git a/app/organization/media/__init__.py b/app/organization/media/__init__.py
new file mode 100644 (file)
index 0000000..a4e2211
--- /dev/null
@@ -0,0 +1,10 @@
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+from mezzanine import __version__  # noqa
+
+
+default_app_config = 'organization.media.apps.MediaConfig'
diff --git a/app/organization/media/admin.py b/app/organization/media/admin.py
new file mode 100644 (file)
index 0000000..8c38f3f
--- /dev/null
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/app/organization/media/apps.py b/app/organization/media/apps.py
new file mode 100644 (file)
index 0000000..0b6445c
--- /dev/null
@@ -0,0 +1,8 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class MediaConfig(AppConfig):
+
+    name = 'organization.media'
diff --git a/app/organization/media/migrations/__init__.py b/app/organization/media/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/media/models.py b/app/organization/media/models.py
new file mode 100644 (file)
index 0000000..3e1ad39
--- /dev/null
@@ -0,0 +1,28 @@
+from __future__ import unicode_literals
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+from mezzanine.core.models import RichText, Displayable, Slugged
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+from mezzanine.utils.models import AdminThumbMixin, upload_to
+
+ALIGNMENT_CHOICES = (('left', _('left')), ('center', _('center')), ('right', _('right')))
+
+
+class Photos(models.Model):
+    """Photo bundle with credits"""
+
+    photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
+    photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
+    photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left", blank=True)
+    photo_description = models.TextField(_('photo description'), blank=True)
+
+    photo_card = FileField(_('card photo'), upload_to='images/photos/card', max_length=1024, blank=True, format="Image")
+    photo_card_credits = models.CharField(_('photo card credits'), max_length=255, blank=True, null=True)
+
+    photo_slider = FileField(_('slider photo'), upload_to='images/photos/slider', max_length=1024, blank=True, format="Image")
+    photo_slider_credits = models.CharField(_('photo slider credits'), max_length=255, blank=True, null=True)
+
+    class Meta:
+        abstract = True
diff --git a/app/organization/media/tests.py b/app/organization/media/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/app/organization/media/views.py b/app/organization/media/views.py
new file mode 100644 (file)
index 0000000..91ea44a
--- /dev/null
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
diff --git a/app/organization/migrations/0001_initial.py b/app/organization/migrations/0001_initial.py
deleted file mode 100644 (file)
index 5c77c28..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-04 10:05
-from __future__ import unicode_literals
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-import mezzanine.core.fields
-import mezzanine.utils.models
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = [
-        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
-        ('sites', '0002_alter_domain_unique'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Activity',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('date_begin', models.DateField(blank=True, null=True, verbose_name='begin date')),
-                ('date_end', models.DateField(blank=True, null=True, verbose_name='end date')),
-                ('role', models.CharField(blank=True, max_length=512, verbose_name='role')),
-                ('work', models.TextField(blank=True, verbose_name='work')),
-            ],
-        ),
-        migrations.CreateModel(
-            name='Department',
-            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')),
-                ('domain', models.CharField(blank=True, max_length=255, verbose_name='domain')),
-                ('weaving_class', models.CharField(blank=True, max_length=64, verbose_name='weaving class')),
-            ],
-            options={
-                'verbose_name': 'department',
-            },
-        ),
-        migrations.CreateModel(
-            name='Link',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('url', models.URLField(verbose_name='URL')),
-            ],
-        ),
-        migrations.CreateModel(
-            name='LinkType',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('name', models.CharField(max_length=256, verbose_name='Name')),
-                ('slug', models.SlugField(blank=True, help_text='Use this field to define a simple identifier that can be used to style the different link types (i.e. assign social media icons to them)', max_length=256, verbose_name='Slug')),
-                ('ordering', models.PositiveIntegerField(blank=True, null=True, verbose_name='Ordering')),
-            ],
-            options={
-                'ordering': ['ordering'],
-            },
-        ),
-        migrations.CreateModel(
-            name='Organization',
-            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')),
-                ('address', models.TextField(blank=True, verbose_name='description')),
-                ('postalcode', models.CharField(blank=True, max_length=16, verbose_name='domain')),
-                ('country', models.CharField(blank=True, max_length=255, verbose_name='domain')),
-                ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
-            ],
-            options={
-                'verbose_name': 'organization',
-            },
-        ),
-        migrations.CreateModel(
-            name='OrganizationType',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('type', models.CharField(max_length=255, verbose_name='type')),
-            ],
-            options={
-                'verbose_name': 'organization type',
-            },
-        ),
-        migrations.CreateModel(
-            name='Person',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
-                ('title', models.CharField(max_length=500, verbose_name='Title')),
-                ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
-                ('_meta_title', models.CharField(blank=True, 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')),
-                ('description', models.TextField(blank=True, verbose_name='Description')),
-                ('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(editable=False, null=True)),
-                ('updated', models.DateTimeField(editable=False, null=True)),
-                ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
-                ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
-                ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
-                ('short_url', models.URLField(blank=True, null=True)),
-                ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
-                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
-                ('person_title', models.CharField(blank=True, choices=[('Dr', 'Dr'), ('Prof', 'Prof'), ('Prof Dr', 'Prof Dr')], max_length=16, verbose_name='title')),
-                ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='first name')),
-                ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='last name')),
-                ('bio', mezzanine.core.fields.RichTextField(blank=True, verbose_name='biography')),
-                ('photo', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo')),
-                ('photo_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits')),
-                ('photo_alignment', models.CharField(blank=True, choices=[('left', 'left'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment')),
-                ('photo_description', models.TextField(blank=True, verbose_name='photo description')),
-                ('photo_featured', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo featured')),
-                ('photo_featured_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo featured credits')),
-                ('organization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.Organization', verbose_name='organization')),
-                ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
-                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
-            ],
-            options={
-                'abstract': False,
-            },
-            bases=(models.Model, mezzanine.utils.models.AdminThumbMixin),
-        ),
-        migrations.CreateModel(
-            name='Team',
-            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')),
-                ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.Department', verbose_name='department')),
-            ],
-            options={
-                'abstract': False,
-            },
-        ),
-        migrations.AddField(
-            model_name='organization',
-            name='organization_type',
-            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.OrganizationType', verbose_name='organization type'),
-        ),
-        migrations.AddField(
-            model_name='link',
-            name='link_type',
-            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.LinkType', verbose_name='Link type'),
-        ),
-        migrations.AddField(
-            model_name='link',
-            name='person',
-            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.Person', verbose_name='Person'),
-        ),
-        migrations.AddField(
-            model_name='department',
-            name='organization',
-            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.Organization', verbose_name='organization'),
-        ),
-        migrations.AddField(
-            model_name='activity',
-            name='person',
-            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.Person', verbose_name='person'),
-        ),
-        migrations.AddField(
-            model_name='activity',
-            name='teams',
-            field=models.ManyToManyField(to='organization.Team', verbose_name='teams'),
-        ),
-    ]
diff --git a/app/organization/migrations/__init__.py b/app/organization/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/organization/models.py b/app/organization/models.py
deleted file mode 100644 (file)
index 20d1465..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-from __future__ import unicode_literals
-
-import os
-import re
-import pwd
-import time
-import urllib
-import string
-import datetime
-import mimetypes
-
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse, reverse_lazy
-from django.conf import settings
-from django.contrib.auth.models import User
-
-from mezzanine.core.models import RichText, Displayable, Slugged
-from mezzanine.core.fields import RichTextField, OrderField, FileField
-from mezzanine.utils.models import AdminThumbMixin, upload_to
-
-from django_countries.fields import CountryField
-
-from media.models import Photos
-
-# Hack to have these strings translated
-mr = _('Mr')
-mrs = _('Ms')
-
-GENDER_CHOICES = [
-    ('male', _('male')),
-    ('female', _('female')),
-]
-
-TITLE_CHOICES = [
-    ('Dr', _('Dr')),
-    ('Prof', _('Prof')),
-    ('Prof Dr', _('Prof Dr')),
-]
-
-ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
-
-
-class Named(models.Model):
-    """Named object with description"""
-
-    name = models.CharField(_('name'), max_length=512)
-    description = models.TextField(_('description'), blank=True)
-
-    class Meta:
-        abstract = True
-
-    def __unicode__(self):
-        return self.name
-
-    @property
-    def slug(self):
-        return slugify(self.__unicode__())
-
-
-class AddressMixin(models.Model):
-    """(Address description)"""
-
-    address = models.TextField(_('description'), blank=True)
-    postal_code = models.CharField(_('postal code'), max_length=16, blank=True)
-    country = CountryField(_('country'))
-
-    def __unicode__(self):
-        return u"Address"
-
-        class Meta:
-            abstract = True
-
-
-class Organization(Named, AddressMixin):
-    """(Organization description)"""
-
-    type = models.ForeignKey('OrganizationType', verbose_name=_('organization type'), blank=True, null=True, on_delete=models.SET_NULL)
-    url = models.URLField(_('URL'), max_length=512, blank=True)
-
-    def __unicode__(self):
-        return self.name
-
-    class Meta:
-        verbose_name = _('organization')
-
-
-class OrganizationType(Named):
-    """(OrganizationType description)"""
-
-    class Meta:
-        verbose_name = _('organization type')
-
-
-class Department(Named):
-    """(Department description)"""
-
-    organization = models.ForeignKey('Organization', verbose_name=_('organization'))
-    url = models.URLField(_('URL'), max_length=512, blank=True)
-    weaving_class = models.CharField(_('weaving class'), max_length=64, blank=True)
-
-    def __unicode__(self):
-        return self.name
-
-    class Meta:
-        verbose_name = _('department')
-
-
-class Team(Named):
-    """(Team description)"""
-
-    department = models.ForeignKey('Department', verbose_name=_('department'), blank=True, null=True, on_delete=models.SET_NULL)
-
-    def __unicode__(self):
-        return u"Team"
-
-
-class Person(Displayable, RichText, AdminThumbMixin, Photos):
-    """(Person description)"""
-
-    user = models.ForeignKey(User, verbose_name=_('user'), blank=True, null=True, on_delete=models.SET_NULL)
-    title = models.CharField(_('title'), max_length=16, choices=TITLE_CHOICES, blank=True)
-    gender = models.CharField(_('gender'), max_length=16, choices=GENDER_CHOICES, blank=True)
-    first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
-    last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
-    birthday = models.DateField(_('birthday'), blank=True)
-    organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
-
-    def __unicode__(self):
-        return ' '.join((self.user.first_name, self.user.last_name))
-
-
-class Nationality(models.Model):
-    """(Nationality description)"""
-
-    name = models.CharField(_('name'))
-
-    def __unicode__(self):
-        return self.name
-
-
-class Link(models.Model):
-    """A person can have many links."""
-
-    person = models.ForeignKey('Person', verbose_name=_('Person'))
-    link_type = models.ForeignKey('LinkType', verbose_name=_('Link type'))
-    url = models.URLField(verbose_name=_('URL'))
-
-    def __str__(self):
-        return self.url
-
-
-class LinkType(models.Model):
-    """
-    A link type could be ``Facebook`` or ``Twitter`` or ``Website``.
-    This is masterdata that should be created by the admins when the site is
-    deployed for the first time.
-    :ordering: Enter numbers here if you want links to be displayed in a
-      special order.
-    """
-
-    name = models.CharField(max_length=256, verbose_name=_('Name'))
-    slug = models.SlugField(max_length=256, verbose_name=_('Slug'), help_text=_(
-            'Use this field to define a simple identifier that can be used'
-            ' to style the different link types (i.e. assign social media'
-            ' icons to them)'),
-        blank=True,
-    )
-    ordering = models.PositiveIntegerField(verbose_name=_('Ordering'), null=True, blank=True)
-
-    class Meta:
-        ordering = ['ordering', ]
-
-    def __str__(self):
-        return self.name
-
-
-class Activity(models.Model):
-    """(Activity description)"""
-
-    person = models.ForeignKey('Person', verbose_name=_('person'))
-    teams = models.ManyToManyField('Team', verbose_name=_('teams'))
-    date_begin = models.DateField(_('begin date'), null=True, blank=True)
-    date_end = models.DateField(_('end date'), null=True, blank=True)
-    role = models.CharField(_('role'), blank=True, max_length=512)
-    work = models.TextField(_('work'), blank=True)
-
-    def __unicode__(self):
-        return ' - '.join((self.person, self.role, self.date_begin, self.date_end))
-
-
-class Modelname(models.Model):
-    """( description)"""
-
-
-    def __unicode__(self):
-        return u""
diff --git a/app/organization/project/__init__.py b/app/organization/project/__init__.py
new file mode 100644 (file)
index 0000000..0358620
--- /dev/null
@@ -0,0 +1,10 @@
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+from mezzanine import __version__  # noqa
+
+
+default_app_config = 'organization.project.apps.ProjectConfig'
diff --git a/app/organization/project/admin.py b/app/organization/project/admin.py
new file mode 100644 (file)
index 0000000..8c38f3f
--- /dev/null
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/app/organization/project/apps.py b/app/organization/project/apps.py
new file mode 100644 (file)
index 0000000..26ba939
--- /dev/null
@@ -0,0 +1,8 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class ProjectConfig(AppConfig):
+
+    name = 'organization.project'
diff --git a/app/organization/project/migrations/0001_initial.py b/app/organization/project/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..e8ea8f5
--- /dev/null
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-06 16:48
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Project',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
+                ('title', models.CharField(max_length=500, verbose_name='Title')),
+                ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
+                ('_meta_title', models.CharField(blank=True, 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')),
+                ('description', models.TextField(blank=True, verbose_name='Description')),
+                ('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(editable=False, null=True)),
+                ('updated', models.DateTimeField(editable=False, null=True)),
+                ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
+                ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
+                ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
+                ('short_url', models.URLField(blank=True, null=True)),
+                ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
+            ],
+            options={
+                'abstract': False,
+            },
+        ),
+    ]
diff --git a/app/organization/project/migrations/0002_auto_20160706_1848.py b/app/organization/project/migrations/0002_auto_20160706_1848.py
new file mode 100644 (file)
index 0000000..266a5d3
--- /dev/null
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-06 16:48
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+        ('project', '0001_initial'),
+        ('structure', '0001_initial'),
+        ('sites', '0002_alter_domain_unique'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='project',
+            name='partners',
+            field=models.ManyToManyField(to='structure.Organization', verbose_name='organizations'),
+        ),
+        migrations.AddField(
+            model_name='project',
+            name='persons',
+            field=models.ManyToManyField(to='structure.Person', verbose_name='persons'),
+        ),
+        migrations.AddField(
+            model_name='project',
+            name='site',
+            field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
+        ),
+    ]
diff --git a/app/organization/project/migrations/__init__.py b/app/organization/project/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/project/models.py b/app/organization/project/models.py
new file mode 100644 (file)
index 0000000..34f61d2
--- /dev/null
@@ -0,0 +1,18 @@
+from __future__ import unicode_literals
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+from mezzanine.core.models import RichText, Displayable, Slugged
+
+from organization.structure.models import Person, Organization
+
+
+class Project(Displayable, RichText):
+    """(Project description)"""
+
+    persons = models.ManyToManyField(Person, verbose_name=_('persons'))
+    partners = models.ManyToManyField(Organization, verbose_name=_('organizations'))
+
+    def __unicode__(self):
+        return self.title
diff --git a/app/organization/project/tests.py b/app/organization/project/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/app/organization/project/views.py b/app/organization/project/views.py
new file mode 100644 (file)
index 0000000..91ea44a
--- /dev/null
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
diff --git a/app/organization/structure/__init__.py b/app/organization/structure/__init__.py
new file mode 100644 (file)
index 0000000..64cb6f5
--- /dev/null
@@ -0,0 +1,10 @@
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+from mezzanine import __version__  # noqa
+
+
+default_app_config = 'organization.structure.apps.StructureConfig'
diff --git a/app/organization/structure/admin.py b/app/organization/structure/admin.py
new file mode 100644 (file)
index 0000000..8c38f3f
--- /dev/null
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/app/organization/structure/apps.py b/app/organization/structure/apps.py
new file mode 100644 (file)
index 0000000..e399e50
--- /dev/null
@@ -0,0 +1,8 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class StructureConfig(AppConfig):
+
+    name = 'organization.structure'
diff --git a/app/organization/structure/migrations/0001_initial.py b/app/organization/structure/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..3589da5
--- /dev/null
@@ -0,0 +1,193 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-06 16:48
+from __future__ import unicode_literals
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+import django_countries.fields
+import mezzanine.core.fields
+import mezzanine.utils.models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+        ('sites', '0002_alter_domain_unique'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Activity',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('date_begin', models.DateField(blank=True, null=True, verbose_name='begin date')),
+                ('date_end', models.DateField(blank=True, null=True, verbose_name='end date')),
+                ('role', models.CharField(blank=True, max_length=512, verbose_name='role')),
+                ('work', models.TextField(blank=True, verbose_name='work')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Address',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('address', models.TextField(blank=True, verbose_name='description')),
+                ('postal_code', models.CharField(blank=True, max_length=16, verbose_name='postal code')),
+                ('country', django_countries.fields.CountryField(max_length=2, verbose_name='country')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Department',
+            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')),
+                ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
+                ('weaving_class', models.CharField(blank=True, max_length=64, verbose_name='weaving class')),
+            ],
+            options={
+                'verbose_name': 'department',
+            },
+        ),
+        migrations.CreateModel(
+            name='Link',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('url', models.URLField(verbose_name='URL')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='LinkType',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=256, verbose_name='Name')),
+                ('slug', models.SlugField(blank=True, help_text='Use this field to define a simple identifier that can be used to style the different link types (i.e. assign social media icons to them)', max_length=256, verbose_name='Slug')),
+                ('ordering', models.PositiveIntegerField(blank=True, null=True, verbose_name='Ordering')),
+            ],
+            options={
+                'ordering': ['ordering'],
+            },
+        ),
+        migrations.CreateModel(
+            name='Modelname',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Nationality',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=128, verbose_name='name')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='OrganizationType',
+            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': 'organization type',
+            },
+        ),
+        migrations.CreateModel(
+            name='Person',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
+                ('title', models.CharField(max_length=500, verbose_name='Title')),
+                ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
+                ('_meta_title', models.CharField(blank=True, 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')),
+                ('description', models.TextField(blank=True, verbose_name='Description')),
+                ('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(editable=False, null=True)),
+                ('updated', models.DateTimeField(editable=False, null=True)),
+                ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
+                ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
+                ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
+                ('short_url', models.URLField(blank=True, null=True)),
+                ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
+                ('photo', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo')),
+                ('photo_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits')),
+                ('photo_alignment', models.CharField(blank=True, choices=[('left', 'left'), ('center', 'center'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment')),
+                ('photo_description', models.TextField(blank=True, verbose_name='photo description')),
+                ('photo_card', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='card photo')),
+                ('photo_card_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo card credits')),
+                ('photo_slider', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='slider photo')),
+                ('photo_slider_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo slider credits')),
+                ('person_title', models.CharField(blank=True, choices=[('Dr', 'Dr'), ('Prof', 'Prof'), ('Prof Dr', 'Prof Dr')], max_length=16, verbose_name='title')),
+                ('gender', models.CharField(blank=True, choices=[('male', 'male'), ('female', 'female')], max_length=16, verbose_name='gender')),
+                ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='first name')),
+                ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='last name')),
+                ('birthday', models.DateField(blank=True, verbose_name='birthday')),
+                ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
+                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
+            ],
+            options={
+                'abstract': False,
+            },
+            bases=(mezzanine.utils.models.AdminThumbMixin, models.Model),
+        ),
+        migrations.CreateModel(
+            name='Team',
+            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')),
+                ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='structure.Department', verbose_name='department')),
+            ],
+            options={
+                'abstract': False,
+            },
+        ),
+        migrations.CreateModel(
+            name='Organization',
+            fields=[
+                ('address_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='structure.Address')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+                ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
+                ('type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='structure.OrganizationType', verbose_name='organization type')),
+            ],
+            options={
+                'verbose_name': 'organization',
+            },
+            bases=('structure.address', models.Model),
+        ),
+        migrations.AddField(
+            model_name='link',
+            name='link_type',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='structure.LinkType', verbose_name='Link type'),
+        ),
+        migrations.AddField(
+            model_name='link',
+            name='person',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='structure.Person', verbose_name='Person'),
+        ),
+        migrations.AddField(
+            model_name='activity',
+            name='person',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='structure.Person', verbose_name='person'),
+        ),
+        migrations.AddField(
+            model_name='activity',
+            name='teams',
+            field=models.ManyToManyField(to='structure.Team', verbose_name='teams'),
+        ),
+        migrations.AddField(
+            model_name='person',
+            name='organization',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='structure.Organization', verbose_name='organization'),
+        ),
+        migrations.AddField(
+            model_name='department',
+            name='organization',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='structure.Organization', verbose_name='organization'),
+        ),
+    ]
diff --git a/app/organization/structure/migrations/__init__.py b/app/organization/structure/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/organization/structure/models.py b/app/organization/structure/models.py
new file mode 100644 (file)
index 0000000..d126734
--- /dev/null
@@ -0,0 +1,182 @@
+from __future__ import unicode_literals
+
+import os
+import re
+import pwd
+import time
+import urllib
+import string
+import datetime
+import mimetypes
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse, reverse_lazy
+from django.conf import settings
+from django.contrib.auth.models import User
+
+from mezzanine.core.models import RichText, Displayable, Slugged
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+from mezzanine.utils.models import AdminThumbMixin, upload_to
+
+from django_countries.fields import CountryField
+
+from organization.media.models import Photos
+from organization.core.models import Named
+
+# Hack to have these strings translated
+mr = _('Mr')
+mrs = _('Ms')
+
+GENDER_CHOICES = [
+    ('male', _('male')),
+    ('female', _('female')),
+]
+
+TITLE_CHOICES = [
+    ('Dr', _('Dr')),
+    ('Prof', _('Prof')),
+    ('Prof Dr', _('Prof Dr')),
+]
+
+ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
+
+
+
+class Address(models.Model):
+    """(Address description)"""
+
+    address = models.TextField(_('description'), blank=True)
+    postal_code = models.CharField(_('postal code'), max_length=16, blank=True)
+    country = CountryField(_('country'))
+
+    def __unicode__(self):
+        return u"Address"
+
+        class Meta:
+            abstract = True
+
+
+class Organization(Named, Address):
+    """(Organization description)"""
+
+    type = models.ForeignKey('OrganizationType', verbose_name=_('organization type'), blank=True, null=True, on_delete=models.SET_NULL)
+    url = models.URLField(_('URL'), max_length=512, blank=True)
+
+    def __unicode__(self):
+        return self.name
+
+    class Meta:
+        verbose_name = _('organization')
+
+
+class OrganizationType(Named):
+    """(OrganizationType description)"""
+
+    class Meta:
+        verbose_name = _('organization type')
+
+
+class Department(Named):
+    """(Department description)"""
+
+    organization = models.ForeignKey('Organization', verbose_name=_('organization'))
+    url = models.URLField(_('URL'), max_length=512, blank=True)
+    weaving_class = models.CharField(_('weaving class'), max_length=64, blank=True)
+
+    def __unicode__(self):
+        return self.name
+
+    class Meta:
+        verbose_name = _('department')
+
+
+class Team(Named):
+    """(Team description)"""
+
+    department = models.ForeignKey('Department', verbose_name=_('department'), blank=True, null=True, on_delete=models.SET_NULL)
+
+    def __unicode__(self):
+        return u"Team"
+
+
+class Person(Displayable, RichText, AdminThumbMixin, Photos):
+    """(Person description)"""
+
+    user = models.ForeignKey(User, verbose_name=_('user'), blank=True, null=True, on_delete=models.SET_NULL)
+    person_title = models.CharField(_('title'), max_length=16, choices=TITLE_CHOICES, blank=True)
+    gender = models.CharField(_('gender'), max_length=16, choices=GENDER_CHOICES, blank=True)
+    first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
+    last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
+    birthday = models.DateField(_('birthday'), blank=True)
+    organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
+
+    def __unicode__(self):
+        return ' '.join((self.user.first_name, self.user.last_name))
+
+
+class Nationality(models.Model):
+    """(Nationality description)"""
+
+    name = models.CharField(_('name'), max_length=128)
+
+    def __unicode__(self):
+        return self.name
+
+
+class Link(models.Model):
+    """A person can have many links."""
+
+    person = models.ForeignKey('Person', verbose_name=_('Person'))
+    link_type = models.ForeignKey('LinkType', verbose_name=_('Link type'))
+    url = models.URLField(verbose_name=_('URL'))
+
+    def __str__(self):
+        return self.url
+
+
+class LinkType(models.Model):
+    """
+    A link type could be ``Facebook`` or ``Twitter`` or ``Website``.
+    This is masterdata that should be created by the admins when the site is
+    deployed for the first time.
+    :ordering: Enter numbers here if you want links to be displayed in a
+      special order.
+    """
+
+    name = models.CharField(max_length=256, verbose_name=_('Name'))
+    slug = models.SlugField(max_length=256, verbose_name=_('Slug'), help_text=_(
+            'Use this field to define a simple identifier that can be used'
+            ' to style the different link types (i.e. assign social media'
+            ' icons to them)'),
+        blank=True,
+    )
+    ordering = models.PositiveIntegerField(verbose_name=_('Ordering'), null=True, blank=True)
+
+    class Meta:
+        ordering = ['ordering', ]
+
+    def __str__(self):
+        return self.name
+
+
+class Activity(models.Model):
+    """(Activity description)"""
+
+    person = models.ForeignKey('Person', verbose_name=_('person'))
+    teams = models.ManyToManyField('Team', verbose_name=_('teams'))
+    date_begin = models.DateField(_('begin date'), null=True, blank=True)
+    date_end = models.DateField(_('end date'), null=True, blank=True)
+    role = models.CharField(_('role'), blank=True, max_length=512)
+    work = models.TextField(_('work'), blank=True)
+
+    def __unicode__(self):
+        return ' - '.join((self.person, self.role, self.date_begin, self.date_end))
+
+
+class Modelname(models.Model):
+    """( description)"""
+
+
+    def __unicode__(self):
+        return u""
diff --git a/app/organization/structure/tests.py b/app/organization/structure/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/app/organization/structure/views.py b/app/organization/structure/views.py
new file mode 100644 (file)
index 0000000..91ea44a
--- /dev/null
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
diff --git a/app/organization/tests.py b/app/organization/tests.py
deleted file mode 100644 (file)
index 7ce503c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/app/organization/views.py b/app/organization/views.py
deleted file mode 100644 (file)
index 91ea44a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.shortcuts import render
-
-# Create your views here.
diff --git a/app/project/__init__.py b/app/project/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/project/admin.py b/app/project/admin.py
deleted file mode 100644 (file)
index 8c38f3f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/app/project/apps.py b/app/project/apps.py
deleted file mode 100644 (file)
index 6b7b799..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-from __future__ import unicode_literals
-
-from django.apps import AppConfig
-
-
-class ProjectConfig(AppConfig):
-    name = 'project'
diff --git a/app/project/migrations/__init__.py b/app/project/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/project/models.py b/app/project/models.py
deleted file mode 100644 (file)
index 1fe139b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-from __future__ import unicode_literals
-
-from django.db import models
-
-from organization import Person
-
-
-class Project(Displayable, RichText):
-    """(Project description)"""
-
-    persons = models.ManyToManyField('Person', verbose_name=_('persons'))
-    partners = models.ManyToManyField('Organization', verbose_name=_('organizations'))
-
-    def __unicode__(self):
-        return self.title
diff --git a/app/project/tests.py b/app/project/tests.py
deleted file mode 100644 (file)
index 7ce503c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/app/project/views.py b/app/project/views.py
deleted file mode 100644 (file)
index 91ea44a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.shortcuts import render
-
-# Create your views here.
index 18b8e05f7326e4f7c003ff101406c748a0cc8ad9..5b6ac93389fa083619f8e796aa3909bdc50ba750 100644 (file)
@@ -213,7 +213,6 @@ INSTALLED_APPS = [
     "mezzanine.core",
     "mezzanine.generic",
     "mezzanine.pages",
-    "custom",
     "mezzanine.blog",
     "mezzanine.forms",
     "mezzanine.galleries",
@@ -224,8 +223,13 @@ INSTALLED_APPS = [
     'djangobower',
     "meta",
     "mezzanine_agenda",
-    "festival",
-    "organization"
+    "organization.core",
+    "organization.structure",
+    # "organization.festival",
+    "organization.magazine",
+    "organization.media",
+    "organization.festival",
+    "organization.project",
 ]
 
 
@@ -247,8 +251,8 @@ MIGRATION_MODULES = {
 }
 
 MODELTRANSLATION_TRANSLATION_FILES = (
-    'custom.translations',
-    'translations',
+    'organization.core.translation',
+    'organization.festival.translation',
 )
 
 TEMPLATES = [{'APP_DIRS': True,
diff --git a/app/structure/models.py b/app/structure/models.py
new file mode 100644 (file)
index 0000000..ec2b748
--- /dev/null
@@ -0,0 +1,198 @@
+from __future__ import unicode_literals
+
+import os
+import re
+import pwd
+import time
+import urllib
+import string
+import datetime
+import mimetypes
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse, reverse_lazy
+from django.conf import settings
+from django.contrib.auth.models import User
+
+from mezzanine.core.models import RichText, Displayable, Slugged
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+from mezzanine.utils.models import AdminThumbMixin, upload_to
+
+from django_countries.fields import CountryField
+
+from organization.media.models import Photos
+
+
+# Hack to have these strings translated
+mr = _('Mr')
+mrs = _('Ms')
+
+GENDER_CHOICES = [
+    ('male', _('male')),
+    ('female', _('female')),
+]
+
+TITLE_CHOICES = [
+    ('Dr', _('Dr')),
+    ('Prof', _('Prof')),
+    ('Prof Dr', _('Prof Dr')),
+]
+
+ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
+
+
+class Named(models.Model):
+    """Named object with description"""
+
+    name = models.CharField(_('name'), max_length=512)
+    description = models.TextField(_('description'), blank=True)
+
+    class Meta:
+        abstract = True
+
+    def __unicode__(self):
+        return self.name
+
+    @property
+    def slug(self):
+        return slugify(self.__unicode__())
+
+
+class AddressMixin(models.Model):
+    """(Address description)"""
+
+    address = models.TextField(_('description'), blank=True)
+    postal_code = models.CharField(_('postal code'), max_length=16, blank=True)
+    country = CountryField(_('country'))
+
+    def __unicode__(self):
+        return u"Address"
+
+        class Meta:
+            abstract = True
+
+
+class Organization(Named, AddressMixin):
+    """(Organization description)"""
+
+    type = models.ForeignKey('OrganizationType', verbose_name=_('organization type'), blank=True, null=True, on_delete=models.SET_NULL)
+    url = models.URLField(_('URL'), max_length=512, blank=True)
+
+    def __unicode__(self):
+        return self.name
+
+    class Meta:
+        verbose_name = _('organization')
+
+
+class OrganizationType(Named):
+    """(OrganizationType description)"""
+
+    class Meta:
+        verbose_name = _('organization type')
+
+
+class Department(Named):
+    """(Department description)"""
+
+    organization = models.ForeignKey('Organization', verbose_name=_('organization'))
+    url = models.URLField(_('URL'), max_length=512, blank=True)
+    weaving_class = models.CharField(_('weaving class'), max_length=64, blank=True)
+
+    def __unicode__(self):
+        return self.name
+
+    class Meta:
+        verbose_name = _('department')
+
+
+class Team(Named):
+    """(Team description)"""
+
+    department = models.ForeignKey('Department', verbose_name=_('department'), blank=True, null=True, on_delete=models.SET_NULL)
+
+    def __unicode__(self):
+        return u"Team"
+
+
+class Person(Displayable, RichText, AdminThumbMixin, Photos):
+    """(Person description)"""
+
+    user = models.ForeignKey(User, verbose_name=_('user'), blank=True, null=True, on_delete=models.SET_NULL)
+    title = models.CharField(_('title'), max_length=16, choices=TITLE_CHOICES, blank=True)
+    gender = models.CharField(_('gender'), max_length=16, choices=GENDER_CHOICES, blank=True)
+    first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
+    last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
+    birthday = models.DateField(_('birthday'), blank=True)
+    organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
+
+    def __unicode__(self):
+        return ' '.join((self.user.first_name, self.user.last_name))
+
+
+class Nationality(models.Model):
+    """(Nationality description)"""
+
+    name = models.CharField(_('name'))
+
+    def __unicode__(self):
+        return self.name
+
+
+class Link(models.Model):
+    """A person can have many links."""
+
+    person = models.ForeignKey('Person', verbose_name=_('Person'))
+    link_type = models.ForeignKey('LinkType', verbose_name=_('Link type'))
+    url = models.URLField(verbose_name=_('URL'))
+
+    def __str__(self):
+        return self.url
+
+
+class LinkType(models.Model):
+    """
+    A link type could be ``Facebook`` or ``Twitter`` or ``Website``.
+    This is masterdata that should be created by the admins when the site is
+    deployed for the first time.
+    :ordering: Enter numbers here if you want links to be displayed in a
+      special order.
+    """
+
+    name = models.CharField(max_length=256, verbose_name=_('Name'))
+    slug = models.SlugField(max_length=256, verbose_name=_('Slug'), help_text=_(
+            'Use this field to define a simple identifier that can be used'
+            ' to style the different link types (i.e. assign social media'
+            ' icons to them)'),
+        blank=True,
+    )
+    ordering = models.PositiveIntegerField(verbose_name=_('Ordering'), null=True, blank=True)
+
+    class Meta:
+        ordering = ['ordering', ]
+
+    def __str__(self):
+        return self.name
+
+
+class Activity(models.Model):
+    """(Activity description)"""
+
+    person = models.ForeignKey('Person', verbose_name=_('person'))
+    teams = models.ManyToManyField('Team', verbose_name=_('teams'))
+    date_begin = models.DateField(_('begin date'), null=True, blank=True)
+    date_end = models.DateField(_('end date'), null=True, blank=True)
+    role = models.CharField(_('role'), blank=True, max_length=512)
+    work = models.TextField(_('work'), blank=True)
+
+    def __unicode__(self):
+        return ' - '.join((self.person, self.role, self.date_begin, self.date_end))
+
+
+class Modelname(models.Model):
+    """( description)"""
+
+
+    def __unicode__(self):
+        return u""
diff --git a/app/translations.py b/app/translations.py
deleted file mode 100644 (file)
index 202c137..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-from modeltranslation.translator import register, TranslationOptions
-
-from mezzanine_agenda.models import Event, EventLocation
-from festival.models import *
-
-
-@register(Event)
-class EventTranslationOptions(TranslationOptions):
-
-    fields = ('title', 'description', 'content')
-
-@register(EventLocation)
-class EventLocationTranslationOptions(TranslationOptions):
-
-    fields = ('description',)
-
-@register(Artist)
-class ArtistTranslationOptions(TranslationOptions):
-
-    fields = ('title', 'description', 'bio', 'content')
-
-
-@register(Video)
-class VideoTranslationOptions(TranslationOptions):
-
-    fields = ('title', 'description', 'content')
-
-
-@register(Audio)
-class AudioTranslationOptions(TranslationOptions):
-
-    fields = ('title', 'description', 'content')
index f952c6374971ff9785ec1e133554250431121459..10df47ebb3ec53d94f45ff8a0e9142fe20c09db3 100644 (file)
@@ -27,7 +27,7 @@ if settings.USE_MODELTRANSLATION:
 
 
 urlpatterns += [
-    url(r'^festival/', include('festival.urls')),
+    url(r'^festival/', include('organization.festival.urls')),
     url("^%s/" % settings.EVENT_SLUG, include("mezzanine_agenda.urls")),
 
     # We don't want to presume how your homepage works, so here are a