]> git.parisson.com Git - mezzo.git/commitdiff
Fix some settings and sync
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 31 Mar 2016 18:20:30 +0000 (20:20 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 31 Mar 2016 18:20:30 +0000 (20:20 +0200)
app/festival/management/commands/sync-eve-events.py
app/festival/templatetags/festival_tags.py
app/migrations/mezzanine_agenda/0004_auto_20160331_1832.py [new file with mode: 0644]
app/sandbox/local_settings.py
requirements-dev.txt

index 9352526bcd4b4089ccae301810c361fcfbd0b37a..e6edc437e06b2f1117faed4292f51f200f97945b 100644 (file)
@@ -23,8 +23,8 @@ class Command(BaseCommand):
     default_user = User.objects.get(username='admin')
 
     def cleanup(self):
-        for event in ma_models.Event.objects.all():
-            event.delete()
+        for event in ma_models.Event.objects.all():
+            event.delete()
         for location in ma_models.EventLocation.objects.all():
             location.delete()
 
@@ -50,8 +50,12 @@ class Command(BaseCommand):
                 event.end = manifestation.happens_at + timedelta(seconds=manifestation.duration)
                 event.title = event_trans.name
                 event.user = self.default_user
-                
-                location, c = ma_models.EventLocation.objects.get_or_create(title=manifestation.location.name)
+
+                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.clean()
index 956cc30298b532bcc221ec8e49734cfe0449b964..e42b10c7e1d350610488889a5498974bd4152ad0 100644 (file)
@@ -28,3 +28,7 @@ def festival_event_featured(*args):
 @register.filter
 def subtract(value, arg):
     return value - arg
+
+@register.as_tag
+def festival_shop_url(*args):
+    return settings.EVENT_SHOP_URL
diff --git a/app/migrations/mezzanine_agenda/0004_auto_20160331_1832.py b/app/migrations/mezzanine_agenda/0004_auto_20160331_1832.py
new file mode 100644 (file)
index 0000000..d48289d
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.2 on 2016-03-31 16:32
+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'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='event',
+            name='location',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mezzanine_agenda.EventLocation'),
+        ),
+    ]
index dec4e3ecb3b742035b9fa5aaa9d87a3d455dee5a..c58e930cac17baa20f01152ae22713a169d375b5 100644 (file)
@@ -38,6 +38,9 @@ DATABASES = {
 
 }
 
+DATABASE_ROUTERS = ['eve.routers.EveRouter',]
+
+
 # EXTENSIONS AND FORMATS
 # Allowed Extensions for File Upload. Lower case is important.
 FILEBROWSER_EXTENSIONS = {
@@ -74,8 +77,6 @@ SITE_TAGLINE = 'Festival 2 juin | 2 juillet 2016'
 
 SILENCED_SYSTEM_CHECKS = ['fields.W342',]
 
-EVENT_USE_FEATURED_IMAGE = True
-
 ADMIN_MENU_ORDER = (
     (_("Content"), ("pages.Page", "blog.BlogPost", "mezzanine_agenda.Event",
         "festival.Artist", "festival.Video", "festival.Audio", "festival.Playlist",
@@ -96,5 +97,6 @@ warnings.filterwarnings(
         RuntimeWarning, r'django\.db\.models\.fields')
 
 EVENT_GOOGLE_MAPS_DOMAIN = 'maps.google.fr'
-
-DATABASE_ROUTERS = ['eve.routers.EveRouter',]
+EVENT_PER_PAGE = 8
+EVENT_USE_FEATURED_IMAGE = True
+EVENT_SHOP_URL = 'http://eve.ircam.fr/pub.php/manifestation/'
index 420203dd193c10371729fecbe705fbb833baf148..4e0ea0ebab83c00be98ab0993fced20ba95866a2 100644 (file)
@@ -1,3 +1,3 @@
--e git+https://github.com/yomguy/mezzanine-agenda.git#egg=mezzanine-agenda-0.2.1
+-e git+https://github.com/yomguy/mezzanine-agenda.git#egg=mezzanine-agenda-0.2.2
 -e git+https://github.com/stephenmcd/mezzanine.git#egg=mezzanine-4.1-dev
 https://forge.ircam.fr/p/django-eve/source/download/dev/