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()
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()
@register.filter
def subtract(value, arg):
return value - arg
+
+@register.as_tag
+def festival_shop_url(*args):
+ return settings.EVENT_SHOP_URL
--- /dev/null
+# -*- 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'),
+ ),
+ ]
}
+DATABASE_ROUTERS = ['eve.routers.EveRouter',]
+
+
# EXTENSIONS AND FORMATS
# Allowed Extensions for File Upload. Lower case is important.
FILEBROWSER_EXTENSIONS = {
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",
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/'
--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/