From 10543341b753ff846f474625fd32514d38c9cf8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 7 Aug 2017 20:51:08 +0100 Subject: [PATCH] The location is not mandatory for an event --- .../0004_event_location_not_mandatory.py | 26 +++++++++++++++++++ gestion/models.py | 1 + 2 files changed, 27 insertions(+) create mode 100644 gestion/migrations/0004_event_location_not_mandatory.py diff --git a/gestion/migrations/0004_event_location_not_mandatory.py b/gestion/migrations/0004_event_location_not_mandatory.py new file mode 100644 index 00000000..31835f2f --- /dev/null +++ b/gestion/migrations/0004_event_location_not_mandatory.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11b1 on 2017-08-07 19:49 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('gestion', '0003_association_and_events'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='location', + field=models.ForeignKey( + blank=True, null=True, + on_delete=django.db.models.deletion.PROTECT, + to='gestion.Location', + verbose_name='lieux' + ), + ), + ] diff --git a/gestion/models.py b/gestion/models.py index 57ebbca2..67757744 100644 --- a/gestion/models.py +++ b/gestion/models.py @@ -179,6 +179,7 @@ class Event(models.Model): title = models.CharField(_("titre"), max_length=200) location = models.ForeignKey( Location, + blank=True, null=True, on_delete=models.PROTECT, verbose_name=_("lieux"), )